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: Return HubModule If a HubModule with a specific name is found, otherwise None.
docstr_tok: ["Return","HubModule","If","a","HubModule","with","a","specific","name","is","found",",","otherwise","None","."]
code: def search(
      self, name: str, source: str = None, branch: str = None
  ) -> HubModule:
      """Return HubModule If a HubModule with a specific name is found, otherwise None."""
      module = None
  
      if name in self._local_modules:
          module = self._local_modules[name]
      else:
          module_dir = self._get_normalized_path(name)
          if os.path.exists(module_dir):
              try:
                  module = self._local_modules[name] = HubModule.load(
                      module_dir
                  )
              except:
                  utils.record_exception(
                      "An error was encountered while loading {}".format(
                          name
                      )
                  )
  
      if not module:
          return None
  
      if source and source != module.source:
          return None
  
      if branch and branch != module.branch:
          return None
  
      return module
  
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 7 for calling the LocalModuleManager obj's underlying member method code with example usage: obj.search(name, source, branch) and returns: module, None, None, None