code: def test_from_huggingface_dataset_constructs_expected_dataset():
      ds = datasets.load_dataset("rotten_tomatoes", split="train")
      mlflow_ds = mlflow.data.from_huggingface(
          ds, path="rotten_tomatoes"
      )
  
      assert isinstance(mlflow_ds, HuggingFaceDataset)
      assert mlflow_ds.ds == ds
      assert mlflow_ds.schema == _infer_schema(ds.to_pandas())
      assert mlflow_ds.profile == {
          "num_rows": ds.num_rows,
          "dataset_size": ds.dataset_size,
          "size_in_bytes": ds.size_in_bytes,
      }
  
      assert isinstance(mlflow_ds.source, HuggingFaceDatasetSource)
  
      with pytest.raises(KeyError, match="Found duplicated arguments*"):
          # Test that we raise an error if the same key is specified in both
          # `HuggingFaceDatasetSource` and `kwargs`.
          mlflow_ds.source.load(path="dummy_path")
  
      reloaded_ds = mlflow_ds.source.load()
      assert reloaded_ds.builder_name == ds.builder_name
      assert reloaded_ds.config_name == ds.config_name
      assert reloaded_ds.split == ds.split == "train"
      assert reloaded_ds.num_rows == ds.num_rows
  
      reloaded_mlflow_ds = mlflow.data.from_huggingface(
          reloaded_ds, path="rotten_tomatoes"
      )
      assert reloaded_mlflow_ds.digest == mlflow_ds.digest
  
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 1 for calling a global function with example usage: test_from_huggingface_dataset_constructs_expected_dataset() without return types