'Looks for a named distribution on the path.
This function only returns the first result found, as no more than one
value is expected. If nothing is found, ``None`` is returned.
:rtype: :class:`InstalledDistribution`, :class:`EggInfoDistribution`
or ``None``'

def get_distribution(self, name):

    result = None
    name = name.lower()
    if (not self._cache_enabled):
        for dist in self._yield_distributions():
            if (dist.key == name):
                result = dist
                break
    else:
        self._generate_cache()
        if (name in self._cache.name):
            result = self._cache.name[name][0]
        elif (self._include_egg and (name in self._cache_egg.name)):
            result = self._cache_egg.name[name][0]
    return result
