code: def test_to_and_from_json(source_uri, source_type):
      dataset_source = resolve_dataset_source(source_uri)
      assert dataset_source._get_source_type() == source_type
      source_json = dataset_source.to_json()
  
      parsed_source_json = json.loads(source_json)
      assert parsed_source_json["uri"] == source_uri
  
      reloaded_source = get_dataset_source_from_json(
          source_json, source_type=dataset_source._get_source_type()
      )
      assert isinstance(reloaded_source, FileSystemDatasetSource)
      assert type(dataset_source) == type(reloaded_source)
      assert reloaded_source.uri == dataset_source.uri
  
file_path: mlflow/tests/data/test_artifact_dataset_sources.py
imports: import json
  import os
  from unittest import mock
  import pytest
  from mlflow.data.dataset_source_registry import get_dataset_source_from_json, resolve_dataset_source
  from mlflow.data.filesystem_dataset_source import FileSystemDatasetSource
  from mlflow.store.artifact.s3_artifact_repo import S3ArtifactRepository
label_desc: Use image node_id 2 for calling a global function with example usage: test_to_and_from_json(source_uri, source_type) without return types