def trans(ele, standard=False):
try:<EOL><INDENT>node = globals().get(ele['<STR_LIT:type>'])<EOL>if not node:<EOL><INDENT>raise NotImplementedError('<STR_LIT>' % ele['<STR_LIT:type>'])<EOL><DEDENT>if standard:<EOL><INDENT>node = node.__dict__[<EOL>'<STR_LIT>'] if '<STR_LIT>' in node.__dict__ else node<EOL><DEDENT>return node(**ele)<EOL><DEDENT>except:<EOL><INDENT>raise<EOL><DEDENT>
Translates esprima syntax tree to python by delegating to appropriate translating node