def pip_get_installed():
from pip._internal.utils.misc import dist_is_local<EOL>return tuple(<EOL>dist_to_req(dist)<EOL>for dist in fresh_working_set()<EOL>if dist_is_local(dist)<EOL>if dist.key != '<STR_LIT>'  <EOL>)<EOL>
Code extracted from the middle of the pip freeze command.
    FIXME: does not list anything installed via -e