code: def test_to_evaluation_dataset():
      source_uri = "test:/my/test/uri"
      x = np.random.sample((2, 2))
      y = np.random.sample((2, 1))
      x_tensors = tf.convert_to_tensor(x)
      y_tensors = tf.convert_to_tensor(y)
      source = TestDatasetSource._resolve(source_uri)
      dataset = TensorFlowDataset(
          features=x_tensors,
          source=source,
          targets=y_tensors,
          name="testname",
      )
      evaluation_dataset = dataset.to_evaluation_dataset()
      assert isinstance(evaluation_dataset, EvaluationDataset)
      assert np.array_equal(
          evaluation_dataset.features_data, dataset.data.numpy()
      )
      assert np.array_equal(
          evaluation_dataset.labels_data, dataset.targets.numpy()
      )
  
imports: import json
  import numpy
  import pytest
  import tensorflow
  import mlflow.data
  from mlflow.data.code_dataset_source import CodeDatasetSource
  from mlflow.data.pyfunc_dataset_mixin import PyFuncInputsOutputs
  from mlflow.data.schema import TensorDatasetSchema
  from mlflow.data.tensorflow_dataset import TensorFlowDataset
  from mlflow.exceptions import MlflowException
  from mlflow.models.evaluation.base import EvaluationDataset
  from mlflow.types.utils import _infer_schema
  from tests.resources.data.dataset_source import TestDatasetSource
label_desc: Use image node_id 12 for calling a global function with example usage: test_to_evaluation_dataset() without return types