def translate_func(name, block, args):
inline = name.startswith('<STR_LIT>')<EOL>real_name = '<STR_LIT>'<EOL>if inline:<EOL><INDENT>name, real_name = name.split('<STR_LIT:@>')<EOL><DEDENT>arglist = '<STR_LIT:U+002CU+0020>'.join(args) + '<STR_LIT:U+002CU+0020>' if args else '<STR_LIT>'<EOL>code = '<STR_LIT>' % (name, arglist)<EOL>scope = "<STR_LIT>"  <EOL>for arg in args:<EOL><INDENT>scope += '<STR_LIT>' % (repr(arg), arg)<EOL><DEDENT>if real_name:<EOL><INDENT>scope += '<STR_LIT>' % (repr(real_name), name)<EOL><DEDENT>code += indent('<STR_LIT>' % scope)<EOL>block, nested_hoisted, nested_inline = remove_functions(block)<EOL>py_code, to_register = translate_flow(block)<EOL>to_register += list(nested_hoisted.keys())<EOL>if to_register:<EOL><INDENT>code += indent('<STR_LIT>' % str(to_register))<EOL><DEDENT>for nested_name, info in nested_hoisted.items():<EOL><INDENT>nested_block, nested_args = info<EOL>new_code = translate_func('<STR_LIT>', nested_block,<EOL>nested_args)<EOL>code += indent(new_code)<EOL>code += indent(<EOL>'<STR_LIT>' % repr(nested_name))<EOL>code += indent(<EOL>'<STR_LIT>' % repr(nested_name))<EOL><DEDENT>for nested_name, info in nested_inline.items():<EOL><INDENT>nested_block, nested_args = info<EOL>new_code = translate_func(nested_name, nested_block, nested_args)<EOL>py_code = inject_before_lval(py_code,<EOL>nested_name.split('<STR_LIT:@>')[<NUM_LIT:0>], new_code)<EOL><DEDENT>if py_code.strip():<EOL><INDENT>code += indent(py_code)<EOL><DEDENT>return code<EOL>
Translates functions and all nested functions to Python code.
       name -  name of that function (global functions will be available under var while
            inline will be available directly under this name )
       block - code of the function (*with* brackets {} )
       args - arguments that this function takes