code: def flatten_to_dict(
      x, name: str, dict_sep: str = "/", list_sep: str = "_"
  ) -> Dict[str, Number]:
      if x is None:
          return {}
      elif isinstance(x, Number):
          return {name: x}
      elif isinstance(x, list):
          return {
              k: v
              for i, inner in enumerate(x)
              for k, v in flatten_to_dict(
                  inner,
                  name=name + list_sep + str(i),
                  dict_sep=dict_sep,
                  list_sep=list_sep,
              ).items()
          }
      elif isinstance(x, dict):
          return {
              k: v
              for iname, inner in x.items()
              for k, v in flatten_to_dict(
                  inner,
                  name=name + dict_sep + iname,
                  dict_sep=dict_sep,
                  list_sep=list_sep,
              ).items()
          }
  
      logger.error("This should never be reached!")
      return {}
  
file_path: ml-cvnets/utils/object_utils.py
imports: import sys
  from numbers import Number
  from typing import Dict
  from common import is_test_env
  from utils import logger
label_desc: Use image node_id 3 for calling a global function with example usage: flatten_to_dict(x, name, dict_sep, list_sep) and returns: dict, dict, dict, unknown, unknown