code: def test_pause_multi_trial_random_searcher_core_api() -> None:
      config = conf.load_config(
          conf.fixtures_path(
              "custom_searcher/core_api_searcher_random.yaml"
          )
      )
      exp_name = f"random-pause-{TIMESTAMP}"
      config["entrypoint"] += " --exp-name " + exp_name
      config["entrypoint"] += " --config-name core_api_model.yaml"
  
      model_def_path = conf.fixtures_path("custom_searcher")
  
      with tempfile.NamedTemporaryFile() as tf:
          with open(tf.name, "w") as f:
              util.yaml_safe_dump(config, f)
  
          searcher_exp_id = exp.create_experiment(
              tf.name, model_def_path, None
          )
          exp.wait_for_experiment_state(
              searcher_exp_id,
              bindings.experimentv1State.RUNNING,
          )
      # make sure both experiments have started by checking
      # that multi-trial experiment has at least 1 running trials
      multi_trial_exp_id = exp.wait_for_experiment_by_name_is_active(
          exp_name, 1
      )
  
      # pause multi-trial experiment
      exp.pause_experiment(multi_trial_exp_id)
      exp.wait_for_experiment_state(
          multi_trial_exp_id, bindings.experimentv1State.PAUSED
      )
  
      # activate multi-trial experiment
      exp.activate_experiment(multi_trial_exp_id)
  
      # wait for searcher to complete
      exp.wait_for_experiment_state(
          searcher_exp_id, bindings.experimentv1State.COMPLETED
      )
  
      # searcher experiment
      searcher_exp = bindings.get_GetExperiment(
          api_utils.determined_test_session(),
          experimentId=searcher_exp_id,
      ).experiment
      assert searcher_exp.state == bindings.experimentv1State.COMPLETED
  
      # actual experiment
      experiment = bindings.get_GetExperiment(
          api_utils.determined_test_session(),
          experimentId=multi_trial_exp_id,
      ).experiment
      assert experiment.numTrials == 5
  
      trials = bindings.get_GetExperimentTrials(
          api_utils.determined_test_session(),
          experimentId=experiment.id,
      ).trials
  
      ok = True
      for trial in trials:
          ok = ok and check_trial_state(
              trial, bindings.trialv1State.COMPLETED
          )
      assert ok, "some trials failed"
  
      for trial in trials:
          assert trial.totalBatchesProcessed == 500
  
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 6 for calling a global function with example usage: test_pause_multi_trial_random_searcher_core_api() without return types