#NEWLINE# def get_installed_distributions( local_only = True , skip = stdlib_pkgs , include_editables = True , editables_only = False , user_only = False ) : #NEWLINE# #INDENT# "\n    Return a list of installed Distribution objects.\n\n    If ``local_only`` is True (default), only return installations\n    local to the current virtualenv, if in a virtualenv.\n\n    ``skip`` argument is an iterable of lower-case project names to\n    ignore; defaults to stdlib_pkgs\n\n    If ``editables`` is False, don't report editables.\n\n    If ``editables_only`` is True , only report editables.\n\n    If ``user_only`` is True , only report installations in the user\n    site directory.\n\n    " #NEWLINE# if local_only : #NEWLINE# #INDENT# local_test = dist_is_local #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# def local_test( d ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# #UNINDENT# if include_editables : #NEWLINE# #INDENT# def editable_test( d ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# def editable_test( d ) : #NEWLINE# #INDENT# return ( not dist_is_editable ( d ) ) #NEWLINE# #UNINDENT# #UNINDENT# if editables_only : #NEWLINE# #INDENT# def editables_only_test( d ) : #NEWLINE# #INDENT# return dist_is_editable ( d ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# def editables_only_test( d ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# #UNINDENT# if user_only : #NEWLINE# #INDENT# user_test = dist_in_usersite #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# def user_test( d ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# #UNINDENT# return [ local_only for d in pkg_resources . working_set if ( local_test ( d ) and ( d . key not in skip ) and editable_test ( d ) and editables_only_test ( d ) and user_test ( d ) ) ]