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 __init__(self, url: str, path: str = None):
      # For some environments where git is not installed, we need to set this environment
      # variable to avoid errors.
      os.environ["GIT_PYTHON_REFRESH"] = "quiet"
      from git import Repo
  
      self.url = url
      self.path = os.path.join(SOURCES_HOME, utils.md5(url))
  
      if self.path.endswith(".git"):
          self.path = self.path[:-4]
  
      if not os.path.exists(self.path):
          log.logger.info(
              "Git repository {} does not exist, download from remote.".format(
                  self.url
              )
          )
          self.repo = Repo.clone_from(self.url, self.path)
      else:
          log.logger.info(
              "Git repository {} is located at {}.".format(
                  self.url, self.path
              )
          )
          self.repo = Repo(self.path)
  
      self.hub_modules = OrderedDict()
      self.load_hub_modules()
  
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 1 to create a new GitSource object from inherited base classes: object with example: obj = GitSource(url, path)