code: def test_dataset_source_conversion_to_json():
      ds = datasets.load_dataset(
          "rotten_tomatoes",
          split="train",
          revision="c33cbf965006dba64f134f7bef69c53d5d0d285d",
      )
      mlflow_ds = mlflow.data.from_huggingface(
          ds,
          path="rotten_tomatoes",
          revision="c33cbf965006dba64f134f7bef69c53d5d0d285d",
      )
      source = mlflow_ds.source
  
      source_json = source.to_json()
      parsed_source = json.loads(source_json)
      assert (
          parsed_source["revision"]
          == "c33cbf965006dba64f134f7bef69c53d5d0d285d"
      )
      assert parsed_source["split"] == "train"
      assert parsed_source["config_name"] == "default"
      assert parsed_source["path"] == "rotten_tomatoes"
      assert not parsed_source["data_dir"]
      assert not parsed_source["data_files"]
  
      reloaded_source = HuggingFaceDatasetSource.from_json(source_json)
      assert json.loads(reloaded_source.to_json()) == parsed_source
  
      reloaded_source = get_dataset_source_from_json(
          source_json, source_type=source._get_source_type()
      )
      assert isinstance(reloaded_source, HuggingFaceDatasetSource)
      assert type(source) == type(reloaded_source)
      assert reloaded_source.to_json() == source.to_json()
  
imports: import json
  import os
  import datasets
  import pandas
  import pytest
  import mlflow.data
  import mlflow.data.huggingface_dataset
  from mlflow.data.code_dataset_source import CodeDatasetSource
  from mlflow.data.dataset_source_registry import get_dataset_source_from_json
  from mlflow.data.huggingface_dataset import HuggingFaceDataset
  from mlflow.data.huggingface_dataset_source import HuggingFaceDatasetSource
  from mlflow.exceptions import MlflowException
  from mlflow.models.evaluation.base import EvaluationDataset
  from mlflow.types.schema import Schema
  from mlflow.types.utils import _infer_schema
label_desc: Use image node_id 10 for calling a global function with example usage: test_dataset_source_conversion_to_json() without return types