code: def _probe_tunnel(
      proc: "subprocess.Popen[str]", port: int = 8265
  ) -> None:
      max_tunnel_time = 300
      start = time.time()
      ctr = 0
      while time.time() - start < max_tunnel_time:
          try:
              r = requests.get(f"http://localhost:{port}", timeout=5)
              if r.status_code == 200:
                  break
          except requests.exceptions.ConnectionError:
              pass
          except requests.exceptions.ReadTimeout:
              pass
          if ctr + 1 % 10 == 0:
              print(f"Tunnel probe pending: {ctr} ticks...")
          time.sleep(1)
          if proc.poll() is not None:
              pytest.fail(
                  f"Tunnel process has exited prematurely, return code: {proc.returncode}"
              )
          ctr += 1
      else:
          pytest.fail(
              f"Failed to probe the tunnel after {max_tunnel_time} seconds"
          )
  
      print(f"Tunnel probe done after {ctr} ticks.")
  
file_path: determined/e2e_tests/tests/cluster/test_proxy.py
imports: import csv
  import pathlib
  import re
  import subprocess
  import time
  from io import StringIO
  import pytest
  import requests
  from determined.common.api import bindings
  from tests import api_utils
  from tests import config
  from tests import experiment
  from tests import ray_utils
label_desc: Use image node_id 2 for calling a global function with example usage: _probe_tunnel(proc, port) without return types