def _generate_cache(self):
gen_dist = not self._cache.generated<EOL>gen_egg = self._include_egg and not self._cache_egg.generated<EOL>if gen_dist or gen_egg:<EOL><INDENT>for dist in self._yield_distributions():<EOL><INDENT>if isinstance(dist, InstalledDistribution):<EOL><INDENT>self._cache.add(dist)<EOL><DEDENT>else:<EOL><INDENT>self._cache_egg.add(dist)<EOL><DEDENT><DEDENT>if gen_dist:<EOL><INDENT>self._cache.generated = True<EOL><DEDENT>if gen_egg:<EOL><INDENT>self._cache_egg.generated = True<EOL><DEDENT><DEDENT>
Scan the path for distributions and populate the cache with
those that are found.