def _function_matcher(matcher_func):
 def match(node):
  try:
   return matcher_func(node)
  except (LookupError, AttributeError, ValueError, TypeError):
   return False
 return match

def _function_matcher ( matcher_func ) : def match ( node ) : try : return matcher_func ( node ) except ( LookupError , AttributeError , ValueError , TypeError ) : return False return match
safer attribute lookup -- returns false instead of raising an error .