def find_descriptor(desc, find_all=False, custom_match=None, **args):
 def desc_iter(**kwargs):
  for d in desc:
   tests = ((val == getattr(d, key)) for (key, val) in kwargs.items())
   if (_interop._all(tests) and ((custom_match is None) or custom_match(d))):
    (yield d)
 if find_all:
  return desc_iter(**args)
 else:
  try:
   return _interop._next(desc_iter(**args))
  except StopIteration:
   return None

def find_descriptor ( desc , find_all = False , custom_match = None , ** args ) : def desc_iter ( ** kwargs ) : for d in desc : tests = ( ( val == getattr ( d , key ) ) for ( key , val ) in kwargs . items ( ) ) if ( _interop . _all ( tests ) and ( ( custom_match is None ) or custom_match ( d ) ) ) : ( yield d ) if find_all : return desc_iter ( ** args ) else : try : return _interop . _next ( desc_iter ( ** args ) ) except StopIteration : return None
find an inner descriptor .