def search_by(lookup, tgt_type='compound', minion_id=None):
 expr_funcs = dict(inspect.getmembers(sys.modules[__name__], predicate=inspect.isfunction))
 matches = []
 for (key, target_list) in lookup.items():
  for target in target_list:
   params = ((target, minion_id) if minion_id else (target,))
   if expr_funcs[tgt_type](*params):
    matches.append(key)
 return (matches or None)

def search_by ( lookup , tgt_type = 'compound' , minion_id = None ) : expr_funcs = dict ( inspect . getmembers ( sys . modules [ __name__ ] , predicate = inspect . isfunction ) ) matches = [ ] for ( key , target_list ) in lookup . items ( ) : for target in target_list : params = ( ( target , minion_id ) if minion_id else ( target , ) ) if expr_funcs [ tgt_type ] ( * params ) : matches . append ( key ) return ( matches or None )
search a dictionary of target strings for matching targets this is the inverse of :py:func:match .