def get_distribution(dist):
 if isinstance(dist, basestring):
  dist = Requirement.parse(dist)
 if isinstance(dist, Requirement):
  dist = get_provider(dist)
 if (not isinstance(dist, Distribution)):
  raise TypeError('Expected string, Requirement, or Distribution', dist)
 return dist

def get_distribution ( dist ) : if isinstance ( dist , basestring ) : dist = Requirement . parse ( dist ) if isinstance ( dist , Requirement ) : dist = get_provider ( dist ) if ( not isinstance ( dist , Distribution ) ) : raise TypeError ( 'Expected string, Requirement, or Distribution' , dist ) return dist
return a current distribution object for a requirement or string .