def dist_factory(path_item, entry, only):
lower = entry.lower()<EOL>is_meta = any(map(lower.endswith, ('<STR_LIT>', '<STR_LIT>')))<EOL>return (<EOL>distributions_from_metadata<EOL>if is_meta else<EOL>find_distributions<EOL>if not only and _is_egg_path(entry) else<EOL>resolve_egg_link<EOL>if not only and lower.endswith('<STR_LIT>') else<EOL>NoDists()<EOL>)<EOL>
Return a dist_factory for a path_item and entry