def METHOD_NAME(stream: TextIO, obj: Any) -> None:
    warn("write_object() is deprecated.", DeprecationWarning, stacklevel=2)
    if hasattr(obj, "to_dict"):
        obj = obj.to_dict()
    data = json.dumps(obj)
    stream.write(data + "\n")