code: def set_in_nested_config(
      config: DictConfig, keymap: list, value: Any
  ) -> None:
      """Set an item in a nested config object using a list of keys.
  
      Args:
          config: DictConfig: nested DictConfig object
          keymap: list[str]: list of keys corresponding to item that should be set.
          value: Any: Value that should be assigned to the dictionary item at the specified location.
  
      Example:
          >>> dummy_config = DictConfig({
              "parent1":{
                  "child1": ['a', 'b', 'c'],
                  "child2": [1, 2, 3]
              },
              "parent2":['model1', 'model2']
          })
          >>> model_config = DictConfig({
              "parent1":{
                  "child1": 'e',
                  "child2": 4,
              },
              "parent3": False
          })
          >>> for run_config in get_run_config(dummy_config):
          >>>    print("Original model config", model_config)
          >>>    print("Suggested config", run_config)
          >>>    for param in run_config.keys():
          >>>        set_in_nested_config(model_config, param.split('.'), run_config[param])
          >>>    print("Replaced model config", model_config)
          >>>    break
          Original model config {'parent1': {'child1': 'e', 'child2': 4}, 'parent3': False}
          Suggested config {'parent1.child1': 'a', 'parent1.child2': 1, 'parent2': 'model1'}
          Replaced model config {'parent1': {'child1': 'a', 'child2': 1}, 'parent3': False, 'parent2': 'model1'}
      """
      get_from_nested_config(config, keymap[:-1])[keymap[-1]] = value
  
file_path: anomalib/src/anomalib/utils/sweep/config.py
imports: from __future__ import annotations
  import itertools
  import operator
  from collections.abc import Iterable, ValuesView
  from functools import reduce
  from typing import Any, Generator
  from omegaconf import DictConfig
label_desc: Use image node_id 5 for calling a global function with example usage: set_in_nested_config(config, keymap, value) without return types