class_docstr: Metadata about the serialized data or functions.
class_docstr_tok: ["Metadata","about","the","serialized","data","or","functions","."]
docstr: Converts json string to metadata object.
docstr_tok: ["Converts","json","string","to","metadata","object","."]
code: def from_json(s):
      """Converts json string to metadata object."""
      try:
          obj = json.loads(s)
      except json.decoder.JSONDecodeError:
          raise DeserializationError(
              "Corrupt metadata file. It is not a valid json file."
          )
  
      sha256_hash = obj.get("sha256_hash")
      metadata = _MetaData(sha256_hash=sha256_hash)
      metadata.version = obj.get("version")
      metadata.python_version = obj.get("python_version")
      metadata.serialization_module = obj.get("serialization_module")
  
      if not sha256_hash:
          raise DeserializationError(
              "Corrupt metadata file. SHA256 hash for the serialized data does not exist. "
              "Please make sure to install SageMaker SDK version >= 2.156.0 on the client side "
              "and try again."
          )
  
      if not (
          metadata.version == "2023-04-24"
          and metadata.serialization_module == "cloudpickle"
      ):
          raise DeserializationError(
              f"Corrupt metadata file. Serialization approach {s} is not supported."
          )
  
      return metadata
  
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 2 for calling the _MetaData obj's underlying member method code with example usage: obj.from_json(s) and returns: metadata