code: def _decode_runtests(
      data: dict[str, Any]
  ) -> RunTests | dict[str, Any]:
      if "__runtests__" in data:
          data.pop("__runtests__")
          if data["hunt_refleak"]:
              data["hunt_refleak"] = HuntRefleak(**data["hunt_refleak"])
          if data["json_file"]:
              data["json_file"] = JsonFile(**data["json_file"])
          return WorkerRunTests(**data)
      else:
          return data
  
imports: import contextlib
  import dataclasses
  import json
  import os
  import subprocess
  from typing import Any
  from test import support
  from .utils import StrPath, StrJSON, TestTuple, TestFilter, FilterTuple, FilterDict
label_desc: Use image node_id 1 for calling a global function with example usage: _decode_runtests(data) and returns: WorkerRunTests, data