code: def _module_from_code(code: str, module_name: str) -> ModuleType:
      """
      Create a python module (containing the generated ``Predictor`` class) from the code. This is both a python object and an associated temporary file on your filesystem
  
      :param code: The ``Predictor``'s code in text form
      :param module_name: The name of the newly created module
  
      :returns: A python module object
      """  # noqa
      dirname = tempfile.gettempdir()
      filename = (
          os.urandom(24).hex()
          + str(time.time()).replace(".", "")
          + ".py"
      )
      path = os.path.join(dirname, filename)
      if "LIGHTWOOD_DEV_SAVE_TO" in os.environ:
          path = os.environ["LIGHTWOOD_DEV_SAVE_TO"]
  
      with open(path, "wb") as fp:
          fp.write(code.encode("utf-8"))
          spec = importlib.util.spec_from_file_location(
              module_name, fp.name
          )
          temp_module = importlib.util.module_from_spec(spec)
          sys.modules[module_name] = temp_module
          spec.loader.exec_module(temp_module)
  
      return temp_module
  
file_path: lightwood/lightwood/helpers/codegen.py
imports: import os
  import sys
  import time
  import string
  import random
  import tempfile
  import importlib
  from copy import deepcopy
  from types import ModuleType
  from type_infer.dtype import dtype
  from lightwood.helpers.log import log
  from lightwood.api.types import JsonAI
  from lightwood.api.json_ai import add_implicit_values, lookup_encoder
  from lightwood.helpers.constants import IMPORTS, IMPORT_EXTERNAL_DIRS
  from lightwood.helpers.templating import call, inline_dict, align
  from lightwood.__about__ import __version__
label_desc: Use image node_id 2 for calling a global function with example usage: _module_from_code(code, module_name) and returns: temp_module