code: def prepare_tmp_dir(path: Path) -> Path:
      path = path.expanduser().resolve()
      path = path / "temp"
  
      if path.exists():
          rmtree(path)
  
      path.mkdir(parents=True, exist_ok=True)
  
      return path
  
imports: from enum import Enum
  from pathlib import Path
  from shutil import rmtree
  import tarfile
  from typing import List
  from typer import Exit
  from typer import Option
  from typing_extensions import Annotated
  from ..core.console import debug
  from ..core.console import error
  from ..core.console import info
  from ..core.console import success
  from ..core.container_engine import ContainerEngine
  from ..core.container_engine import ContainerEngineError
  from ..core.container_engine import Docker
  from ..core.container_engine import Podman
  from ..core.syft_repo import SyftRepo
  from ..core.syft_version import InvalidVersion
  from ..core.syft_version import SyftVersion
label_desc: Use image node_id 8 for calling a global function with example usage: prepare_tmp_dir(path) and returns: path