docstr: Parses and returns a DatasetSource object from its JSON representation.
  
  Args:
      source_json: The JSON representation of the DatasetSource.
      source_type: The string type of the DatasetSource, which indicates how to parse the
          source JSON.
docstr_tok: ["Parses","and","returns","a","DatasetSource","object","from","its","JSON","representation",".","Args",":","source_json",":","The","JSON","representation","of","the","DatasetSource",".","source_type",":","The","string","type","of","the","DatasetSource",",","which","indicates","how","to","parse","the","source","JSON","."]
code: def get_source_from_json(
      self, source_json: str, source_type: str
  ) -> DatasetSource:
      """Parses and returns a DatasetSource object from its JSON representation.
  
      Args:
          source_json: The JSON representation of the DatasetSource.
          source_type: The string type of the DatasetSource, which indicates how to parse the
              source JSON.
      """
      for source in reversed(self.sources):
          if source._get_source_type() == source_type:
              return source.from_json(source_json)
  
      raise MlflowException(
          f"Could not parse dataset source from JSON due to unrecognized"
          f" source type: {source_type}.",
          RESOURCE_DOES_NOT_EXIST,
      )
  
file_path: mlflow/mlflow/data/dataset_source_registry.py
imports: import warnings
  from typing import Any, List, Optional
  import entrypoints
  from mlflow.data.artifact_dataset_sources import register_artifact_dataset_sources
  from mlflow.data.dataset_source import DatasetSource
  from mlflow.data.http_dataset_source import HTTPDatasetSource
  from mlflow.exceptions import MlflowException
  from mlflow.protos.databricks_pb2 import RESOURCE_DOES_NOT_EXIST
label_desc: Use image node_id 5 for calling the DatasetSourceRegistry obj's underlying member method code with example usage: obj.get_source_from_json(source_json, source_type) and returns: source