code: def clone(data, kwargs=None):
      """
      Create a copy of a given value, by calling `encode` and `decode` on it.
  
      If `kwargs` is provided, it's possible to overwrite nested values.
      """
      encoded = encode(data)
      if kwargs:
          encoded.update(kwargs)
  
      return decode(encoded)
  
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 9 for calling a global function with example usage: clone(data, kwargs) and returns: decode