code: def _run_test_case(path: Path) -> tuple[ProcStatus, float, str, str]:
      code = f"""\
  __file__ = {str(path)!r}
  
  import random
  random.seed(1)
  
  import numpy as np
  np.random.seed(1)
  
  import warnings
  warnings.filterwarnings("ignore", ".*", UserWarning, "matplotlib.font_manager")
  
  with open(__file__, "rb") as file:
      source = file.read()
  
  global_vars = {{}}
  exec(compile(source, __file__, "exec"), global_vars)
  
  output = global_vars.get("output")
  if output is None:
      raise RuntimeError("'output' not exported from a test case")
  
  from bokeh.document import Document
  from bokeh.model import Model
  
  if isinstance(output, Model):
      doc = Document()
      doc.add_root(output)
  elif isinstance(output, Document):
      doc = output
  else:
      raise RuntimeError("invalid 'output', expected a 'Model' or 'Document'")
  
  rep = doc.to_json(deferred=False)
  del rep["title"]
  del rep["version"]
  
  import json5
  json = json5.dumps(rep, sort_keys=False, indent=2)
  print(json)
  """
  
      cmd = [sys.executable, "-c", code]
      cwd = path.parent
  
      env = os.environ.copy()
  
      class Timeout(Exception):
          pass
  
      if sys.platform != "win32":
  
          def alarm_handler(
              sig: int, frame: FrameType | None
          ) -> NoReturn:
              raise Timeout
  
          signal.signal(signal.SIGALRM, alarm_handler)
          signal.alarm(TIMEOUT)
  
      start = time.time()
      with subprocess.Popen(
          cmd,
          cwd=cwd,
          env=env,
          stdout=subprocess.PIPE,
          stderr=subprocess.PIPE,
      ) as proc:
          status: ProcStatus
          try:
              status = proc.wait()
          except Timeout:
              proc.kill()
              status = "timeout"
          finally:
              if sys.platform != "win32":
                  signal.alarm(0)
  
          end = time.time()
  
          assert proc.stdout is not None
          assert proc.stderr is not None
  
          out = proc.stdout.read().decode("utf-8")
          err = proc.stderr.read().decode("utf-8")
  
      return (status, end - start, out, err)
  
file_path: bokeh/tests/test_cross.py
imports: from __future__ import annotations
  import pytest
  import os
  import signal
  import subprocess
  import sys
  import time
  from pathlib import Path
  from typing import TYPE_CHECKING, Literal, NoReturn, Union
  import _pytest.config
  import _pytest.mark
  import _pytest.python
label_desc: Use image node_id 3 for calling a global function with example usage: _run_test_case(path) and returns: status,  unknown,  out,  err