  from common.params import Params
  from common.timeout import Timeout
  from selfdrive.car.fingerprints import FW_VERSIONS
  from selfdrive.car.car_helpers import get_car, interfaces
  from selfdrive.manager.process import PythonProcess
  from selfdrive.manager.process_config import managed_processes
  
  # Numpy gives different results based on CPU features after version 19
  NUMPY_TOLERANCE = 1e-7
  CI = "CI" in os.environ
 
</s> remove   finally:
    teardown_prefix()
 </s> add  </s> remove   setup_prefix()
  try:
 </s> add   with OpenpilotPrefix(): </s> remove def setup_prefix():
  os.environ['OPENPILOT_PREFIX'] = str(uuid.uuid4())
  msgq_path = os.path.join('/dev/shm', os.environ['OPENPILOT_PREFIX'])
  try:
    os.mkdir(msgq_path)
  except FileExistsError:
    pass


def teardown_prefix():
  if not os.environ.get("OPENPILOT_PREFIX", 0):
    return
  symlink_path = Params().get_param_path()
  if os.path.exists(symlink_path):
    shutil.rmtree(os.path.realpath(symlink_path), ignore_errors=True)
    os.remove(symlink_path)
  msgq_path = os.path.join('/dev/shm', os.environ['OPENPILOT_PREFIX'])
  shutil.rmtree(msgq_path, ignore_errors=True)

 </s> add  </s> remove import uuid
 </s> add  </s> remove import shutil
 </s> add 
from selfdrive.test.process_replay.helpers import OpenpilotPrefix
  from common.params import Params
  from common.timeout import Timeout
  from selfdrive.car.fingerprints import FW_VERSIONS
  from selfdrive.car.car_helpers import get_car, interfaces
from selfdrive.test.process_replay.helpers import OpenpilotPrefix
  from selfdrive.manager.process import PythonProcess
  from selfdrive.manager.process_config import managed_processes
  
  # Numpy gives different results based on CPU features after version 19
  NUMPY_TOLERANCE = 1e-7
  CI = "CI" in os.environ
keep keep keep add keep keep keep keep keep keep
 process replay: prefix setup in helper (#24636)

* prefix setup in helper

* context manager

* name change + none default

* skip checking prefix

* type hints + unset env 
selfdrive/test/process_replay/process_replay.py