@_with_ast_loc<EOL>def _local_sym_to_py_ast(<EOL>ctx: GeneratorContext, node: Local, is_assigning: bool = False<EOL>) -> GeneratedPyAST:
assert node.op == NodeOp.LOCAL<EOL>sym_entry = ctx.symbol_table.find_symbol(sym.symbol(node.name))<EOL>assert sym_entry is not None<EOL>if node.local == LocalType.FIELD:<EOL><INDENT>this_entry = ctx.symbol_table.find_symbol(ctx.current_this)<EOL>assert this_entry is not None, "<STR_LIT>"<EOL>return GeneratedPyAST(<EOL>node=_load_attr(<EOL>f"<STR_LIT>",<EOL>ctx=ast.Store() if is_assigning else ast.Load(),<EOL>)<EOL>)<EOL><DEDENT>else:<EOL><INDENT>return GeneratedPyAST(<EOL>node=ast.Name(<EOL>id=sym_entry.munged, ctx=ast.Store() if is_assigning else ast.Load()<EOL>)<EOL>)<EOL><DEDENT>
Generate a Python AST node for accessing a locally defined Python variable.