#NEWLINE# def prune( self , filter_func = None , from_stash = None , to_stash = None ) : #NEWLINE# #INDENT# "\n        Prune unsatisfiable paths from a stash.\n\n        :param filter_func: Only prune paths that match this filter.\n        :param from_stash:  Prune paths from this stash. (default: 'active')\n        :param to_stash:    Put pruned paths in this stash. (default: 'pruned')\n\n        :returns:           The resulting PathGroup.\n        :rtype:             PathGroup\n        " #NEWLINE# to_stash = ( 'pruned' if ( to_stash is None ) else to_stash ) #NEWLINE# from_stash = ( 'active' if ( from_stash is None ) else from_stash ) #NEWLINE# ( to_prune , new_active ) = self . _filter_paths ( filter_func , self . stashes [ from_stash ] ) #NEWLINE# new_stashes = self . _copy_stashes ( ) #NEWLINE# for p in to_prune : #NEWLINE# #INDENT# if ( p . errored or ( not p . state . satisfiable ( ) ) ) : #NEWLINE# #INDENT# if ( to_stash not in new_stashes ) : #NEWLINE# #INDENT# new_stashes [ to_stash ] = [ ] #NEWLINE# #UNINDENT# new_stashes [ to_stash ] . append ( p ) #NEWLINE# if self . _hierarchy : #NEWLINE# #INDENT# self . _hierarchy . unreachable ( p ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# new_active . append ( p ) #NEWLINE# #UNINDENT# #UNINDENT# new_stashes [ filter_func ] = new_active #NEWLINE# return self . _successor ( new_stashes )