code: def test_tracer_component_with_code_in_dir(tmp_path):
      """This test ensures the Tracer Component gets the latest code from the code object that is provided and arguments
      are cleaned."""
  
      drive = Drive("lit://code")
      drive.component_name = "something"
      code = Code(drive=drive, name="sample.tar.gz")
  
      with open("file.py", "w") as f:
          f.write('raise Exception("An error")')
  
      with tarfile.open("sample.tar.gz", "w:gz") as tar:
          tar.add("file.py")
  
      drive.put("sample.tar.gz")
      os.remove("file.py")
      os.remove("sample.tar.gz")
  
      python_script = TracerPythonScript(
          "file.py",
          script_args=["--b=1"],
          raise_exception=False,
          code=code,
      )
      run_work_isolated(
          python_script,
          params={"--a": "1"},
          restart_count=0,
          code_dir=str(tmp_path),
      )
      assert "An error" in python_script.status.message
  
      assert os.path.exists(os.path.join(str(tmp_path), "file.py"))
  
file_path: pytorch-lightning/tests/tests_app/components/python/test_python.py
imports: import os
  import tarfile
  import pytest
  from lightning.app.components.python import PopenPythonScript, TracerPythonScript
  from lightning.app.components.python.tracer import Code
  from lightning.app.storage.drive import Drive
  from lightning.app.testing.helpers import _RunIf
  from lightning.app.testing.testing import run_work_isolated
  from lightning.app.utilities.component import _set_work_context
  from lightning.app.utilities.enum import CacheCallsKeys
  from tests_app import _PROJECT_ROOT
label_desc: Use image node_id 7 for calling a global function with example usage: test_tracer_component_with_code_in_dir(tmp_path) without return types