code: def _fill_config(
      config: Dict,
      attr: str,
      search_space: Union[dict, list, tuple, Callable, Domain],
  ):
      """Add attr to config by sampling from search_space.
  
      This is a helper used to set initial hyperparameter values if the user doesn't
      specify them in the Tuner `param_space`.
      """
      if isinstance(search_space, Callable):
          config[attr] = search_space()
      elif isinstance(search_space, Domain):
          config[attr] = search_space.sample(None)
      elif isinstance(search_space, (list, tuple)):
          config[attr] = random.choice(search_space)
      elif isinstance(search_space, dict):
          config[attr] = {}
          for k, v in search_space.items():
              _fill_config(config[attr], k, v)
  
imports: import copy
  import json
  import logging
  import math
  import os
  import random
  import shutil
  import warnings
  from pathlib import Path
  from typing import Callable, Dict, List, Optional, Tuple, Union, TYPE_CHECKING
  from ray.air.constants import TRAINING_ITERATION
  from ray.train import Checkpoint
  from ray.train._internal.session import _TrainingResult, _FutureTrainingResult
  from ray.tune.error import TuneError
  from ray.tune.result import DEFAULT_METRIC
  from ray.tune.search import SearchGenerator
  from ray.tune.utils.util import SafeFallbackEncoder
  from ray.tune.search.sample import Domain, Function
  from ray.tune.schedulers import FIFOScheduler, TrialScheduler
  from ray.tune.search.variant_generator import format_vars
  from ray.tune.experiment import Trial
  from ray.util import PublicAPI
  from ray.util.debug import log_once
label_desc: Use image node_id 3 for calling a global function with example usage: _fill_config(config, attr, search_space) without return types