def get_installed_distributions(local_only=True,<EOL>skip=stdlib_pkgs,<EOL>include_editables=True,<EOL>editables_only=False,<EOL>user_only=False):<EOL>
if local_only:<EOL><INDENT>local_test = dist_is_local<EOL><DEDENT>else:<EOL><INDENT>def local_test(d):<EOL><INDENT>return True<EOL><DEDENT><DEDENT>if include_editables:<EOL><INDENT>def editable_test(d):<EOL><INDENT>return True<EOL><DEDENT><DEDENT>else:<EOL><INDENT>def editable_test(d):<EOL><INDENT>return not dist_is_editable(d)<EOL><DEDENT><DEDENT>if editables_only:<EOL><INDENT>def editables_only_test(d):<EOL><INDENT>return dist_is_editable(d)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>def editables_only_test(d):<EOL><INDENT>return True<EOL><DEDENT><DEDENT>if user_only:<EOL><INDENT>user_test = dist_in_usersite<EOL><DEDENT>else:<EOL><INDENT>def user_test(d):<EOL><INDENT>return True<EOL><DEDENT><DEDENT>return [d for d in pkg_resources.working_set  <EOL>if local_test(d) and<EOL>d.key not in skip and<EOL>editable_test(d) and<EOL>editables_only_test(d) and<EOL>user_test(d)<EOL>]<EOL>
Return a list of installed Distribution objects.

If ``local_only`` is True (default), only return installations
local to the current virtualenv, if in a virtualenv.

``skip`` argument is an iterable of lower-case project names to
ignore; defaults to stdlib_pkgs

If ``include_editables`` is False, don't report editables.

If ``editables_only`` is True , only report editables.

If ``user_only`` is True , only report installations in the user
site directory.