parameters: (path_item, entry, only)
return_statement: return (
          distributions_from_metadata
          if is_meta else
          find_distributions
          if not only and _is_egg_path(entry) else
          resolve_egg_link
          if not only and lower.endswith('.egg-link') else
          NoDists()
      )
docstring: Return a dist_factory for the given entry.
docstring_summary: Return a dist_factory for the given entry.
docstring_tokens: Return a dist_factory for the given entry .
function: def dist_factory(path_item, entry, only):
      """Return a dist_factory for the given entry."""
      lower = entry.lower()
      is_egg_info = lower.endswith('.egg-info')
      is_dist_info = (
          lower.endswith('.dist-info') and
          os.path.isdir(os.path.join(path_item, entry))
      )
      is_meta = is_egg_info or is_dist_info
      return (
          distributions_from_metadata
          if is_meta else
          find_distributions
          if not only and _is_egg_path(entry) else
          resolve_egg_link
          if not only and lower.endswith('.egg-link') else
          NoDists()
      )
function_tokens: def dist_factory ( path_item , entry , only ) : lower = entry . lower ( ) is_egg_info = lower . endswith ( '.egg-info' ) is_dist_info = ( lower . endswith ( '.dist-info' ) and os . path . isdir ( os . path . join ( path_item , entry ) ) ) is_meta = is_egg_info or is_dist_info return ( distributions_from_metadata if is_meta else find_distributions if not only and _is_egg_path ( entry ) else resolve_egg_link if not only and lower . endswith ( '.egg-link' ) else NoDists ( ) )