parameters: (req_name)
return_statement: return pkg_dict.get(req_name)
docstring: Find a distribution matching the ``req_name`` in the environment.
  
  
  
      This searches from *all* distributions available in the environment, to
  
      match the behavior of ``pkg_resources.get_distribution()``.
docstring_summary: Find a distribution matching the ``req_name`` in the environment.
docstring_tokens: Find a distribution matching the req_name in the environment .
function: def _search_distribution(req_name):
  
      # type: (str) -> Optional[Distribution]
  
      """Find a distribution matching the ``req_name`` in the environment.
  
  
  
      This searches from *all* distributions available in the environment, to
  
      match the behavior of ``pkg_resources.get_distribution()``.
  
      """
  
      # Canonicalize the name before searching in the list of
  
      # installed distributions and also while creating the package
  
      # dictionary to get the Distribution object
  
      req_name = canonicalize_name(req_name)
  
      packages = get_installed_distributions(
  
          local_only=False,
  
          skip=(),
  
          include_editables=True,
  
          editables_only=False,
  
          user_only=False,
  
          paths=None,
  
      )
  
      pkg_dict = {canonicalize_name(p.key): p for p in packages}
  
      return pkg_dict.get(req_name)
function_tokens: def _search_distribution ( req_name ) : # type: (str) -> Optional[Distribution] # Canonicalize the name before searching in the list of # installed distributions and also while creating the package # dictionary to get the Distribution object req_name = canonicalize_name ( req_name ) packages = get_installed_distributions ( local_only = False , skip = ( ) , include_editables = True , editables_only = False , user_only = False , paths = None , ) pkg_dict = { canonicalize_name ( p . key ) : p for p in packages } return pkg_dict . get ( req_name )