#NEWLINE# def get_installed_distributions( local_only = True , skip = ( 'setuptools' , 'pip' , 'python' ) , include_editables = True , editables_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 ('setuptools', 'pip', 'python'). [FIXME also\n    skip virtualenv?]\n\n    If ``editables`` is False, don't report editables.\n\n    If ``editables_only`` is True , only report editables.\n\n    " #NEWLINE# if local_only : #NEWLINE# #INDENT# local_test = dist_is_local #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# local_test = ( lambda d : True ) #NEWLINE# #UNINDENT# if include_editables : #NEWLINE# #INDENT# editable_test = ( lambda d : True ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# editable_test = ( lambda d : ( not dist_is_editable ( d ) ) ) #NEWLINE# #UNINDENT# if editables_only : #NEWLINE# #INDENT# editables_only_test = ( lambda d : dist_is_editable ( d ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# editables_only_test = ( lambda d : True ) #NEWLINE# #UNINDENT# return [ d 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 ) ) ]