code: def _make_test_experiment_config(
      config: Dict[str, Any]
  ) -> Dict[str, Any]:
      """
      Create a test experiment that based on a modified version of the
      experiment config of the request and monitors its progress for success.
      The test experiment is created as archived to be not user-visible by
      default.
  
      The experiment configuration is modified such that:
      1. Only train one batch.
      2. The experiment does not attempt restarts on failure.
      3. All checkpoints are GC'd after experiment finishes.
      """
      config_test = config.copy()
      config_test.update(
          {
              "description": "[test-mode] {}".format(
                  config_test.get("description", str(uuid.uuid4()))
              ),
              "scheduling_unit": 1,
              "min_validation_period": {"batches": 1},
              "checkpoint_storage": {
                  **config_test.get("checkpoint_storage", {}),
                  "save_experiment_best": 0,
                  "save_trial_best": 0,
                  "save_trial_latest": 0,
              },
              "searcher": {
                  "name": "single",
                  "metric": config_test["searcher"]["metric"],
                  "max_length": {"batches": 1},
              },
              "hyperparameters": _generate_random_hparam_values(
                  config_test.get("hyperparameters", {})
              ),
              "resources": config_test.get(
                  "resources", {"slots_per_trial": 1}
              ),
              "max_restarts": 0,
          }
      )
  
      return config_test
  
imports: import contextlib
  import logging
  import math
  import os
  import pathlib
  import random
  import sys
  import uuid
  from typing import Any, Dict, Iterator, List, Optional, Tuple, Type
  import determined
  from determined import constants, core, gpu, load
label_desc: Use image node_id 4 for calling a global function with example usage: _make_test_experiment_config(config) and returns: config_test