def find_on_path(importer, path_item, only=False):
path_item = _normalize_cached(path_item)<EOL>if _is_unpacked_egg(path_item):<EOL><INDENT>yield Distribution.from_filename(<EOL>path_item, metadata=PathMetadata(<EOL>path_item, os.path.join(path_item, '<STR_LIT>')<EOL>)<EOL>)<EOL>return<EOL><DEDENT>entries = safe_listdir(path_item)<EOL>filtered = (<EOL>entry<EOL>for entry in entries<EOL>if dist_factory(path_item, entry, only)<EOL>)<EOL>path_item_entries = _by_version_descending(filtered)<EOL>for entry in path_item_entries:<EOL><INDENT>fullpath = os.path.join(path_item, entry)<EOL>factory = dist_factory(path_item, entry, only)<EOL>for dist in factory(fullpath):<EOL><INDENT>yield dist<EOL><DEDENT><DEDENT>
Yield distributions accessible on a sys.path directory