def in_special_context(node):
 global p0, p1, p2, pats_built
 if (not pats_built):
  p1 = patcomp.compile_pattern(p1)
  p0 = patcomp.compile_pattern(p0)
  p2 = patcomp.compile_pattern(p2)
  pats_built = True
 patterns = [p0, p1, p2]
 for (pattern, parent) in zip(patterns, attr_chain(node, 'parent')):
  results = {}
  if (pattern.match(parent, results) and (results['node'] is node)):
   return True
 return False

def in_special_context ( node ) : global p0 , p1 , p2 , pats_built if ( not pats_built ) : p1 = patcomp . compile_pattern ( p1 ) p0 = patcomp . compile_pattern ( p0 ) p2 = patcomp . compile_pattern ( p2 ) pats_built = True patterns = [ p0 , p1 , p2 ] for ( pattern , parent ) in zip ( patterns , attr_chain ( node , 'parent' ) ) : results = { } if ( pattern . match ( parent , results ) and ( results [ 'node' ] is node ) ) : return True return False
returns true if node is in an environment where all that is required of it is being itterable .