code: def _assign(params: Parameters, key: ParameterKey, x: Any) -> None:
      if len(key) == 1:
          params[cast(str, key[0])] = x
      elif isinstance(key[0], int):
          _assign(params, key[1:], x)
      else:
          if key[0] not in params:
              params[key[0]] = {}
          _assign(params[key[0]], key[1:], x)
  
file_path: nni/nni/common/hpo_utils/formatting.py
imports: from __future__ import annotations
  import math
  from types import SimpleNamespace
  from typing import Any, Dict, NamedTuple, Tuple, cast
  import numpy
  from nni.typehint import Parameters, SearchSpace
label_desc: Use image node_id 7 for calling a global function with example usage: _assign(params, key, x) without return types