(config=None, only_nlp=False)
Import all modules for register.
Import all modules for register.
Import all modules for register .
def import_all_modules_for_register(config=None, only_nlp=False):
  """Import all modules for register."""
  if only_nlp:
    all_modules = ALL_NLP_MODULES
  else:
    all_modules = ALL_MODULES

  add_custom_modules(all_modules, config)

  logging.debug(f"All modules: {all_modules}")
  errors = []
  for base_dir, modules in all_modules:
    for name in modules:
      try:
        if base_dir != "":
          full_name = base_dir + "." + name
        else:
          full_name = name
        importlib.import_module(full_name)
        logging.debug(f"{full_name} loaded.")
      except ImportError as error:
        errors.append((name, error))
  _handle_errors(errors)
def import_all_modules_for_register ( config = None , only_nlp = False ) : if only_nlp : all_modules = ALL_NLP_MODULES else : all_modules = ALL_MODULES add_custom_modules ( all_modules , config ) logging . debug ( f"All modules: {all_modules}" ) errors = [ ] for base_dir , modules in all_modules : for name in modules : try : if base_dir != "" : full_name = base_dir + "." + name else : full_name = name importlib . import_module ( full_name ) logging . debug ( f"{full_name} loaded." ) except ImportError as error : errors . append ( ( name , error ) ) _handle_errors ( errors )