code: def encode(obj) -> dict:
      """
      Encode a given object into a flat-dictionary.
  
      It uses the default-encoding, to then flatten the output.
      """
      encoded = base_encode(obj)
  
      result: dict = {}
      _encode(encoded, "", result)
      return result
  
file_path: gluonts/src/gluonts/core/serde/flat.py
imports: from collections import defaultdict
  from itertools import count
  from typing import Any
  from toolz.dicttoolz import keymap, valmap
  from ._base import encode, Kind, decode
label_desc: Use image node_id 8 for calling a global function with example usage: encode(obj) and returns: result