class_docstr: Git source for PaddleHub module
  
  Args:
      url(str) : Url of git repository
      path(str) : Path to store the git repository
class_docstr_tok: ["Git","source","for","PaddleHub","module","Args",":","url","(","str",")",":","Url","of","git","repository","path","(","str",")",":","Path","to","store","the","git","repository"]
code: def load_hub_modules(self):
      if "hubconf" in sys.modules:
          sys.modules.pop("hubconf")
  
      sys.path.insert(0, self.path)
      try:
          with open(os.path.join(self.path, "hubconf.py"), "r") as file:
              pycode = file.read()
              ast_module = ast.parse(pycode)
              for _body in ast_module.body:
                  if not isinstance(
                      _body, (ast.Import, ast.ImportFrom)
                  ):
                      continue
  
                  if not _body.module.endswith("module"):
                      continue
  
                  subpath = ".".join(_body.module.split(".")[:-2])
                  subpath = os.path.join(self.path, subpath)
                  sys.path.insert(0, subpath)
  
          py_module = importlib.import_module("hubconf")
          for _item, _cls in inspect.getmembers(
              py_module, inspect.isclass
          ):
              _item = py_module.__dict__[_item]
              if issubclass(_item, RunModule):
                  self.hub_modules[_item.name] = _item
      except:
          self.hub_modules = OrderedDict()
          utils.record_exception(
              "An error occurred while loading {}".format(self.path)
          )
  
      sys.path.remove(self.path)
  
file_path: PaddleHub/paddlehub/server/git_source.py
imports: import ast
  import inspect
  import importlib
  import os
  import sys
  from collections import OrderedDict
  from typing import List
  from paddlehub.module.module import RunModule
  from paddlehub.env import SOURCES_HOME
  from paddlehub.utils import log, utils
label_desc: Use image node_id 4 for calling the GitSource obj's underlying member method code with example usage: obj.load_hub_modules() without return types