class_docstr: The ScriptRunner executes the script using ``runpy`` and also patches the Trainer methods to inject additional
  code.
code: def __init__(self, root_path: str, *args: Any, **kwargs: Any) -> None:
      super().__init__(
          *args,
          cloud_build_config=self._get_build_config(root_path),
          **kwargs,
      )
      self.root_path = root_path
      self.exception_message: str = ""
      self.trainer_progress: dict = {}
      self.trainer_state: dict = {}
      self.trainer_hparams: dict = {}
      self.model_hparams: dict = {}
      self.log_dir: Optional[Path] = None
      self.checkpoint_dir: Optional[Path] = None
      self.logger_metadatas: List[Dict[str, str]] = []
  
file_path: pytorch-lightning/src/lightning/app/cli/pl-app-template/core/components/script_runner/script_runner.py
imports: import sys
  import traceback
  from typing import Any, Dict, List, Optional, Tuple
  from lightning.app.components.python import TracerPythonScript
  from lightning.app.storage.path import Path
  from lightning.app.utilities.packaging.build_config import BuildConfig, load_requirements
  from lightning.app.utilities.tracer import Tracer
label_desc: Use image node_id 1 to create a new ScriptRunner object from inherited base classes: TracerPythonScript with example: obj = ScriptRunner(root_path)