class_docstr: Metadata about the serialized data or functions.
class_docstr_tok: ["Metadata","about","the","serialized","data","or","functions","."]
docstr: Converts metadata to json string.
docstr_tok: ["Converts","metadata","to","json","string","."]
code: def to_json(self):
      """Converts metadata to json string."""
      return json.dumps(dataclasses.asdict(self)).encode()
  
imports: from __future__ import absolute_import
  import dataclasses
  import json
  import io
  import sys
  import hmac
  import hashlib
  import pickle
  from typing import Any, Callable, Union
  import cloudpickle
  from tblib import pickling_support
  from sagemaker.remote_function.errors import ServiceError, SerializationError, DeserializationError
  from sagemaker.s3 import S3Downloader, S3Uploader
  from sagemaker.session import Session
  from ._custom_dispatch_table import dispatch_table
label_desc: Use image node_id 1 for calling the _MetaData obj's underlying member method code with example usage: obj.to_json() and returns: json