#NEWLINE# def _scalar( self , name , * selection , **kwargs ) : #NEWLINE# #INDENT# if ( not selection ) : #NEWLINE# #INDENT# return sorted ( set ( [ getattr ( line , name ) for line in self ] ) , key = self . _get_sort_key ) #NEWLINE# #UNINDENT# mode = kwargs . pop ( 'mode' , 'any' ) #NEWLINE# selection = set ( selection ) #NEWLINE# lines = [ ] #NEWLINE# for line in self : #NEWLINE# #INDENT# passes = [ ] #NEWLINE# value = getattr ( line , name ) #NEWLINE# for select in selection : #NEWLINE# #INDENT# if ( passes and ( mode == 'any' ) and any ( passes ) ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# if self . _scalar_match ( value , select ) : #NEWLINE# #INDENT# passes . append ( True ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# passes . append ( False ) #NEWLINE# #UNINDENT# #UNINDENT# if ( passes and ( mode == 'any' ) and any ( passes ) ) : #NEWLINE# #INDENT# lines . append ( line ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( passes and ( mode == 'all' ) and all ( passes ) ) : #NEWLINE# #INDENT# lines . append ( line ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( mode == 'none' ) and ( ( not passes ) or ( not any ( passes ) ) ) ) : #NEWLINE# #INDENT# lines . append ( line ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( mode == 'only' ) and passes and all ( passes ) and ( len ( passes ) == len ( value ) ) ) : #NEWLINE# #INDENT# lines . append ( line ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return self . __class__ ( set ( lines ) )