@contextfilter
def do_selectattr(*args, **kwargs):
 return select_or_reject(args, kwargs, (lambda x: x), True)

@ contextfilter def do_selectattr ( * args , ** kwargs ) : return select_or_reject ( args , kwargs , ( lambda x : x ) , True )
filters a sequence of objects by appying a test to either the object or the attribute and only selecting the ones with the test succeeding .