class_docstr: Helper class uses for constructing Python bytecode
class_docstr_tok: ["Helper","class","uses","for","constructing","Python","bytecode"]
docstr: Store value in a new global
docstr_tok: ["Store","value","in","a","new","global"]
code: def setup_globally_cached(self, name, value, push_null):
      """Store value in a new global"""
      name = re.sub(r"[^a-zA-Z0-9_]+", "_", name)
      f_globals = self.tx.f_globals
      if name in f_globals:
          assert id(f_globals[name]) == id(value)
      else:
          f_globals[name] = value
      return [self.create_load_global(name, push_null, add=True)]
  
imports: import collections
  import dataclasses
  import re
  import sys
  import types
  from typing import Counter, Dict, List, Optional
  import torch.nn
  from .None import utils
  from .bytecode_transformation import create_call_function, create_dup_top, create_instruction, create_load_global, create_rot_n, Instruction
  from .exc import unimplemented
  from .source import AttrSource, Source
  from .utils import is_safe_constant, rot_n_helper
  from .variables.base import VariableTracker
  from .variables.nn_module import NNModuleVariable
  from .variables.tensor import NumpyNdarrayVariable, SymNodeVariable, TensorVariable, UnspecializedPythonVariable
  from .variables.torch_function import TensorWithTFOverrideVariable
label_desc: Use image node_id 9 for calling the PyCodegen obj's underlying member method code with example usage: obj.setup_globally_cached(name, value, push_null) and returns: list