class_docstr: Compile and run Python source code.
  
      
docstr: Args:
      source (str) :
          A string containing Python source code to execute
  
      path (str) :
          A filename to use in any debugging or error output
  
      argv (list[str]) :
          A list of string arguments to make available as ``sys.argv``
          when the code executes
  
      package (bool) :
          An optional package module to configure
  
  Raises:
      ValueError, if package is specified for an __init__.py
docstr_tok: ["Args",":","source","(","str",")",":","A","string","containing","Python","source","code","to","execute","path","(","str",")",":","A","filename","to","use","in","any","debugging","or","error","output","argv","(","list","[","str","]",")",":","A","list","of","string","arguments","to","make","available","as","``","sys.argv","``","when","the","code","executes","package","(","bool",")",":","An","optional","package","module","to","configure","Raises",":","ValueError",",","if","package","is","specified","for","an","__init__.py"]
code: def __init__(
      self,
      source: str,
      path: PathLike,
      argv: list[str],
      package: ModuleType | None = None,
  ) -> None:
      """
  
      Args:
          source (str) :
              A string containing Python source code to execute
  
          path (str) :
              A filename to use in any debugging or error output
  
          argv (list[str]) :
              A list of string arguments to make available as ``sys.argv``
              when the code executes
  
          package (bool) :
              An optional package module to configure
  
      Raises:
          ValueError, if package is specified for an __init__.py
  
      """
      if package and basename(path) == "__init__.py":
          raise ValueError("__init__.py cannot have package specified")
  
      self._permanent_error = None
      self._permanent_error_detail = None
      self.reset_run_errors()
  
      import ast
  
      self._code = None
  
      try:
          nodes = ast.parse(source, os.fspath(path))
          self._code = compile(
              nodes, filename=path, mode="exec", dont_inherit=True
          )
          # use a zip to associate code names with values, to then find the contents of the docstring
          d = dict(zip(self._code.co_names, self._code.co_consts))
          self._doc = d.get("__doc__", None)
      except SyntaxError as e:
          self._code = None
          filename = (
              os.path.basename(e.filename)
              if e.filename is not None
              else "???"
          )
          self._permanent_error = f"Invalid syntax in {filename!r} on line {e.lineno or '???'}:\n{e.text or '???'}"
          self._permanent_error_detail = traceback.format_exc()
  
      self._path = path
      self._source = source
      self._argv = argv
      self._package = package
      self.ran = False
  
imports: from __future__ import annotations
  import logging
  import os
  import sys
  import traceback
  from os.path import basename
  from types import CodeType, ModuleType
  from typing import Callable
  from ...core.types import PathLike
  from ...util.serialization import make_globally_unique_id
  from .handler import handle_exception
label_desc: Use image node_id 1 to create a new CodeRunner object  with example: obj = CodeRunner(source, path, argv, package)