code: def dumps(obj, **kwargs):
      
      kwargs["cls"] = _ref_encoder_factory(kwargs.get("cls", json.JSONEncoder))
      return json.dumps(obj, **kwargs)
docs: Serialize `obj`, which may contain :class:`JsonRef` objects, to a JSON
      formatted string. `JsonRef` objects will be dumped as the original
      reference object they were created from.
  
      :param obj: Object to serialize
      :param kwargs: Keyword arguments are the same as to :func:`json.dumps`