code: def test_resume_random_searcher_exp(exceptions: List[str]) -> None:
      config = conf.load_config(conf.fixtures_path("no_op/single.yaml"))
      config["searcher"] = {
          "name": "custom",
          "metric": "validation_error",
          "smaller_is_better": True,
          "unit": "batches",
      }
      config["description"] = (
          ";".join(exceptions) if exceptions else "custom searcher"
      )
  
      max_trials = 5
      max_concurrent_trials = 2
      max_length = 500
      failures_expected = len(exceptions)
      logging.info(f"expected_failures={failures_expected}")
  
      # do not use pytest tmp_path to experience LocalSearchRunner in the wild
      with tempfile.TemporaryDirectory() as searcher_dir:
          failures = 0
          while failures < failures_expected:
              try:
                  exception_point = exceptions.pop(0)
                  # re-create RandomSearchMethod and LocalSearchRunner after every fail
                  # to simulate python process crash
                  search_method = searchers.RandomSearchMethod(
                      max_trials,
                      max_concurrent_trials,
                      max_length,
                      test_type="noop",
                      exception_points=[exception_point],
                  )
                  search_runner_mock = FallibleSearchRunner(
                      exception_point,
                      search_method,
                      pathlib.Path(searcher_dir),
                  )
                  search_runner_mock.run(
                      config, model_dir=conf.fixtures_path("no_op")
                  )
                  pytest.fail("Expected an exception")
              except connectionpool.MaxRetryError:
                  failures += 1
  
          assert failures == failures_expected
  
          search_method = searchers.RandomSearchMethod(
              max_trials,
              max_concurrent_trials,
              max_length,
              test_type="noop",
          )
          search_runner = searcher.LocalSearchRunner(
              search_method, pathlib.Path(searcher_dir)
          )
          experiment_id = search_runner.run(
              config, model_dir=conf.fixtures_path("no_op")
          )
  
      assert search_runner.state.last_event_id == 41
      assert search_runner.state.experiment_completed is True
      assert client._determined is not None
      session = client._determined._session
      response = bindings.get_GetExperiment(
          session, experimentId=experiment_id
      )
      assert response.experiment.numTrials == 5
      assert search_method.created_trials == 5
      assert search_method.pending_trials == 0
      assert search_method.closed_trials == 5
      assert (
          len(search_runner.state.trials_created)
          == search_method.created_trials
      )
      assert (
          len(search_runner.state.trials_closed)
          == search_method.closed_trials
      )
  
      assert search_method.progress(
          search_runner.state
      ) == pytest.approx(1.0)
  
imports: import logging
  import pathlib
  import subprocess
  import tempfile
  import time
  from typing import Iterator, List, Optional
  import pytest
  from urllib3 import connectionpool
  from determined import searcher
  from determined.common import util
  from determined.common.api import bindings
  from determined.experimental import client
  from tests import api_utils
  from tests import config
  from tests import experiment
  from tests.fixtures.custom_searcher import searchers
label_desc: Use image node_id 7 for calling a global function with example usage: test_resume_random_searcher_exp(exceptions) without return types