code: def flatten_dict(
      d: MutableMapping, parent_key: str = "", delimiter: str = "."
  ):
      """Flatten a nested dict into a single level dict."""
  
      def _flatten_dict(d, parent_key="", delimiter="."):
          for k, v in d.items():
              key = (
                  str(parent_key) + delimiter + str(k)
                  if parent_key
                  else k
              )
              if v and isinstance(v, MutableMapping):
                  yield from flatten_dict(
                      v, key, delimiter=delimiter
                  ).items()
              else:
                  yield key, v
  
      return dict(_flatten_dict(d, parent_key, delimiter))
  
imports: import inspect
  import tempfile
  from collections import OrderedDict, UserDict
  from collections.abc import MutableMapping
  from contextlib import ExitStack, contextmanager
  from dataclasses import fields, is_dataclass
  from enum import Enum
  from typing import Any, ContextManager, Iterable, List, Tuple
  import numpy
  from .import_utils import is_flax_available, is_tf_available, is_torch_available, is_torch_fx_proxy
label_desc: Use image node_id 23 for calling a global function with example usage: flatten_dict(d, parent_key, delimiter) and returns: dict