docs: def json_encode(obj: Instance, **kwargs) -> str:
      """
      Encodes an object to JSON using our custom encoder.
  
      The ``**kwargs`` can be used to pass things like ``'indent'``, for
      formatting.
      """
      return json.dumps(obj, cls=JsonClassEncoder, **kwargs)