class_docstr: PredictionSingleton
docstr: Returns the object represented by the json string
docstr_tok: ["Returns","the","object","represented","by","the","json","string"]
code: def from_json(cls, json_str: str) -> PredictionSingleton:
      """Returns the object represented by the json string"""
      instance = PredictionSingleton.construct()
      error_messages = []
      match = 0
  
      # use oneOf discriminator to lookup the data type
      _data_type = json.loads(json_str).get("type")
      if not _data_type:
          raise ValueError(
              "Failed to lookup data type from the field `type` in the input."
          )
  
      # check if data type is `PredictionSingletonClassification`
      if _data_type == "CLASSIFICATION":
          instance.actual_instance = (
              PredictionSingletonClassification.from_json(json_str)
          )
          return instance
  
      # check if data type is `PredictionSingletonInstanceSegmentation`
      if _data_type == "INSTANCE_SEGMENTATION":
          instance.actual_instance = (
              PredictionSingletonInstanceSegmentation.from_json(
                  json_str
              )
          )
          return instance
  
      # check if data type is `PredictionSingletonKeypointDetection`
      if _data_type == "KEYPOINT_DETECTION":
          instance.actual_instance = (
              PredictionSingletonKeypointDetection.from_json(json_str)
          )
          return instance
  
      # check if data type is `PredictionSingletonObjectDetection`
      if _data_type == "OBJECT_DETECTION":
          instance.actual_instance = (
              PredictionSingletonObjectDetection.from_json(json_str)
          )
          return instance
  
      # check if data type is `PredictionSingletonClassification`
      if _data_type == "PredictionSingletonClassification":
          instance.actual_instance = (
              PredictionSingletonClassification.from_json(json_str)
          )
          return instance
  
      # check if data type is `PredictionSingletonInstanceSegmentation`
      if _data_type == "PredictionSingletonInstanceSegmentation":
          instance.actual_instance = (
              PredictionSingletonInstanceSegmentation.from_json(
                  json_str
              )
          )
          return instance
  
      # check if data type is `PredictionSingletonKeypointDetection`
      if _data_type == "PredictionSingletonKeypointDetection":
          instance.actual_instance = (
              PredictionSingletonKeypointDetection.from_json(json_str)
          )
          return instance
  
      # check if data type is `PredictionSingletonObjectDetection`
      if _data_type == "PredictionSingletonObjectDetection":
          instance.actual_instance = (
              PredictionSingletonObjectDetection.from_json(json_str)
          )
          return instance
  
      # check if data type is `PredictionSingletonSemanticSegmentation`
      if _data_type == "PredictionSingletonSemanticSegmentation":
          instance.actual_instance = (
              PredictionSingletonSemanticSegmentation.from_json(
                  json_str
              )
          )
          return instance
  
      # check if data type is `PredictionSingletonSemanticSegmentation`
      if _data_type == "SEMANTIC_SEGMENTATION":
          instance.actual_instance = (
              PredictionSingletonSemanticSegmentation.from_json(
                  json_str
              )
          )
          return instance
  
      # deserialize data into PredictionSingletonClassification
      try:
          instance.actual_instance = (
              PredictionSingletonClassification.from_json(json_str)
          )
          match += 1
      except (ValidationError, ValueError) as e:
          error_messages.append(str(e))
      # deserialize data into PredictionSingletonObjectDetection
      try:
          instance.actual_instance = (
              PredictionSingletonObjectDetection.from_json(json_str)
          )
          match += 1
      except (ValidationError, ValueError) as e:
          error_messages.append(str(e))
      # deserialize data into PredictionSingletonSemanticSegmentation
      try:
          instance.actual_instance = (
              PredictionSingletonSemanticSegmentation.from_json(
                  json_str
              )
          )
          match += 1
      except (ValidationError, ValueError) as e:
          error_messages.append(str(e))
      # deserialize data into PredictionSingletonInstanceSegmentation
      try:
          instance.actual_instance = (
              PredictionSingletonInstanceSegmentation.from_json(
                  json_str
              )
          )
          match += 1
      except (ValidationError, ValueError) as e:
          error_messages.append(str(e))
      # deserialize data into PredictionSingletonKeypointDetection
      try:
          instance.actual_instance = (
              PredictionSingletonKeypointDetection.from_json(json_str)
          )
          match += 1
      except (ValidationError, ValueError) as e:
          error_messages.append(str(e))
  
      if match > 1:
          # more than 1 match
          raise ValueError(
              "Multiple matches found when deserializing the JSON string into PredictionSingleton with oneOf schemas: PredictionSingletonClassification, PredictionSingletonInstanceSegmentation, PredictionSingletonKeypointDetection, PredictionSingletonObjectDetection, PredictionSingletonSemanticSegmentation. Details: "
              + ", ".join(error_messages)
          )
      elif match == 0:
          # no match
          raise ValueError(
              "No match found when deserializing the JSON string into PredictionSingleton with oneOf schemas: PredictionSingletonClassification, PredictionSingletonInstanceSegmentation, PredictionSingletonKeypointDetection, PredictionSingletonObjectDetection, PredictionSingletonSemanticSegmentation. Details: "
              + ", ".join(error_messages)
          )
      else:
          return instance
  
imports: from __future__ import annotations
  from inspect import getfullargspec
  import json
  import pprint
  import re
  from typing import Any, List, Optional
  from pydantic import BaseModel, Field, StrictStr, ValidationError, validator
  from lightly.openapi_generated.swagger_client.models.prediction_singleton_classification import PredictionSingletonClassification
  from lightly.openapi_generated.swagger_client.models.prediction_singleton_instance_segmentation import PredictionSingletonInstanceSegmentation
  from lightly.openapi_generated.swagger_client.models.prediction_singleton_keypoint_detection import PredictionSingletonKeypointDetection
  from lightly.openapi_generated.swagger_client.models.prediction_singleton_object_detection import PredictionSingletonObjectDetection
  from lightly.openapi_generated.swagger_client.models.prediction_singleton_semantic_segmentation import PredictionSingletonSemanticSegmentation
  from typing import Any, List
  from pydantic import StrictStr, Field, Extra
label_desc: Use image node_id 4 for calling the PredictionSingleton obj's underlying member method code with example usage: obj.from_json(cls, json_str) and returns: instance, instance, instance, instance, instance, instance, instance, instance, instance, instance, instance