def _astnode(s):
 try:
  import compiler
 except ImportError:
  return eval(s)
 p = compiler.parse(('__tempvalue__ = ' + s))
 return p.getChildren()[1].getChildren()[0].getChildren()[1]

def _astnode ( s ) : try : import compiler except ImportError : return eval ( s ) p = compiler . parse ( ( '__tempvalue__ = ' + s ) ) return p . getChildren ( ) [ 1 ] . getChildren ( ) [ 0 ] . getChildren ( ) [ 1 ]
return a python ast node compiled from a string .