class_docstr: LocalModuleManager is used to manage PaddleHub's local Module, which supports the installation, uninstallation,
  and search of HubModule. LocalModuleManager is a singleton object related to the path, in other words, when the
  LocalModuleManager object of the same home directory is generated multiple times, the same object is returned.
  
  Args:
      home (str): The directory where PaddleHub modules are stored, the default is ~/.paddlehub/modules
class_docstr_tok: ["LocalModuleManager","is","used","to","manage","PaddleHub","'s","local","Module",",","which","supports","the","installation",",","uninstallation",",","and","search","of","HubModule",".","LocalModuleManager","is","a","singleton","object","related","to","the","path",",","in","other","words",",","when","the","LocalModuleManager","object","of","the","same","home","directory","is","generated","multiple","times",",","the","same","object","is","returned",".","Args",":","home","(","str",")",":","The","directory","where","PaddleHub","modules","are","stored",",","the","default","is","~\/.paddlehub\/modules"]
docstr: Install a HubModule from git repository
docstr_tok: ["Install","a","HubModule","from","git","repository"]
code: def _install_from_source(
      self,
      name: str,
      version: str,
      source: str,
      update: bool = False,
      branch: str = None,
  ) -> HubModule:
      """Install a HubModule from git repository"""
      result = module_server.search_module(
          name=name,
          source=source,
          version=version,
          update=update,
          branch=branch,
      )
      for item in result:
          if item["name"] == name and item["version"].match(version):
              # uninstall local module
              local_module = self.search(name)
              if (
                  local_module
                  and local_module.source == source
                  and local_module.branch == branch
              ):
                  self._local_modules[name] = local_module
                  return self._local_modules[name]
  
              if os.path.exists(self._get_normalized_path(name)):
                  self.uninstall(name)
  
              installed_path = self._get_normalized_path(name)
              shutil.copytree(item["path"], installed_path)
  
              source_info_file = os.path.join(
                  installed_path, "_source_info.yaml"
              )
              with open(source_info_file, "w") as file:
                  file.write("source: {}\n".format(source))
                  file.write("branch: {}".format(branch))
  
              # Install python package requirements, This behavior needs to occur before Module.load,
              # otherwise the model will fail to load due to missing dependencies.
              self._install_module_requirements(installed_path)
  
              self._local_modules[name] = HubModule.load(installed_path)
  
              if version:
                  log.logger.info(
                      "Successfully installed {}-{}".format(
                          name, version
                      )
                  )
              else:
                  log.logger.info(
                      "Successfully installed {}".format(name)
                  )
              return self._local_modules[name]
  
      raise HubModuleNotFoundError(
          name=name, version=version, source=source
      )
  
imports: import os
  import shutil
  import sys
  from collections import OrderedDict
  from typing import List
  import filelock
  from paddlehub.env import MODULE_HOME, TMP_HOME
  from paddlehub.module.module import Module
  from paddlehub.server import module_server
  from paddlehub.utils import xarfile, log, utils, pypi
label_desc: Use image node_id 11 for calling the LocalModuleManager obj's underlying member method code with example usage: obj._install_from_source(name, version, source, update, branch) and returns: self, self