code: def nested_to_flat(nested_dict, separator="."):
      flat_dict = dict()
  
      def helper(val, subkey_prefix=""):
          for k, v in val.items():
              if isinstance(v, dict):
                  helper(v, subkey_prefix=subkey_prefix + k + separator)
              else:
                  flat_dict[subkey_prefix + k] = v
  
      helper(nested_dict)
      return flat_dict
  
imports: import typing
  from dataclasses import fields, is_dataclass
  from functools import lru_cache
  from typeguard import check_type
label_desc: Use image node_id 13 for calling a global function with example usage: nested_to_flat(nested_dict, separator) and returns: flat_dict