def which_package(path):
 path = abspath(path)
 prefix = which_prefix(path)
 if (prefix is None):
  raise RuntimeError((u'could not determine conda prefix from: %s' % path))
 for dist in linked(prefix):
  meta = is_linked(prefix, dist)
  if any(((abspath(join(prefix, f)) == path) for f in meta[u'files'])):
   (yield dist)

def which_package ( path ) : path = abspath ( path ) prefix = which_prefix ( path ) if ( prefix is None ) : raise RuntimeError ( ( u'could not determine conda prefix from: %s' % path ) ) for dist in linked ( prefix ) : meta = is_linked ( prefix , dist ) if any ( ( ( abspath ( join ( prefix , f ) ) == path ) for f in meta [ u'files' ] ) ) : ( yield dist )
given the path (of a conda installed file) iterate over the conda packages the file came from .