code: def encode_nested_parameters(obj) -> dict:
      return serde.flat.encode(obj)
  
imports: import re
  from collections import defaultdict
  from toolz.dicttoolz import valmap
  from gluonts.core import serde
label_desc: Use image node_id 3 for calling a global function with example usage: encode_nested_parameters(obj) and returns: serde