@classmethod
  def distribution_from_path(cls, path, name=None):
    # Monkeypatch pkg_resources finders should it not already be so.
    register_finders()
    if name is None:
      distributions = list(find_distributions(path))
      if len(distributions) == 1:
        return distributions[0]
    else:
      for dist in find_distributions(path):
        if dist.project_name == name:
          return dist
Return a distribution from a path.
dataset/ETHPy150Open pantsbuild/pex/pex/util.py/DistributionHelper.distribution_from_path