code: def flatten(dictionary, sep="."):
      """Turn all nested dict keys into a {key}{sep}{subkey} format"""
  
      def _flatten(dictionary):
          if dictionary == {}:
              return dictionary
  
          key, value = dictionary.popitem()
          if not isinstance(value, dict) or not value:
              new_dictionary = {key: value}
              new_dictionary.update(flatten(dictionary, sep=sep))
              return new_dictionary
  
          flat_sub_dictionary = flatten(value, sep=sep)
          for flat_sub_key in list(flat_sub_dictionary.keys()):
              flat_key = key + sep + flat_sub_key
              flat_sub_dictionary[flat_key] = flat_sub_dictionary.pop(
                  flat_sub_key
              )
  
          new_dictionary = flat_sub_dictionary
          new_dictionary.update(flatten(dictionary, sep=sep))
          return new_dictionary
  
      return _flatten(copy.deepcopy(dictionary))
  
label_desc: Use image node_id 1 for calling a global function with example usage: flatten(dictionary, sep) and returns: _flatten, new_dictionary, dictionary, new_dictionary