def select_functions(methods, data):
 s = set()
 for (condition, funcs) in methods:
  if match(condition, data):
   s |= funcs
 return dict(((name(func), func) for func in s))

def select_functions ( methods , data ) : s = set ( ) for ( condition , funcs ) in methods : if match ( condition , data ) : s |= funcs return dict ( ( ( name ( func ) , func ) for func in s ) )
select appropriate functions given types and predicates .