code: def default(o):
      if isinstance(o, (datetime.date, datetime.datetime)):
          return o.isoformat()
      if isinstance(o, utils.JsCode):
          return (
              o.replace("\\n|\\t", "")
              .replace(r"\\n", "\n")
              .replace(r"\\t", "\t")
              .js_code
          )
      if isinstance(o, BasicOpts):
          if isinstance(o.opts, Sequence):
              return [
                  utils.remove_key_with_none_value(item)
                  for item in o.opts
              ]
          else:
              return utils.remove_key_with_none_value(o.opts)
  
imports: import datetime
  import uuid
  import simplejson
  from jinja2 import Environment
  from ..commons import utils
  from ..globals import CurrentConfig, RenderType, ThemeType
  from ..options import InitOpts, RenderOpts
  from ..options.global_options import AnimationOpts
  from ..options.series_options import BasicOpts
  from ..render import engine
  from ..types import Optional, Sequence, Union
  from .mixins import ChartMixin
label_desc: Use image node_id 1 for calling a global function with example usage: default(o) and returns: o, o, unknown, utils