code: def dump_json(o: Any, indent: Optional[int] = None) -> str:
      """
      Serializes an object to a JSON string.
  
      Parameters
      ----------
      o
          The object to serialize.
      indent
          An optional number of spaced to use as an indent.
  
      Returns
      -------
      str
          A string representing the object in JSON format.
  
      See Also
      --------
      load_json
          Inverse function.
      """
      return json.dumps(encode(o), indent=indent, sort_keys=True)
  
imports: import json
  from typing import Any, Optional
  from ._base import decode, encode
label_desc: Use image node_id 1 for calling a global function with example usage: dump_json(o, indent) and returns: json