code: def test_train_dataset_uri(tmpdir):
      input_df = pd.DataFrame(
          {
              "input": [
                  "a",
                  "b",
                  "a",
                  "b",
                  "a",
                  "b",
                  "c",
                  "c",
                  "a",
                  "b",
              ],
              "output": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
              "split": [0, 0, 0, 0, 0, 0, 0, 1, 2, 2],
          }
      )
  
      extracted_filename = "input.csv"
      compression_opts = dict(
          method="zip", archive_name=extracted_filename
      )
  
      archive_filename = os.path.join(tmpdir, "archive.zip")
      input_df.to_csv(
          archive_filename, index=False, compression=compression_opts
      )
  
      dataset_name = f"fake_csv_dataset_{uuid.uuid4().hex}"
      config = DatasetConfig(
          version=1.0,
          name=dataset_name,
          download_urls=["file://" + archive_filename],
      )
  
      model_config = {
          "input_features": [{"name": "input", "type": "category"}],
          "output_features": [{"name": "output", "type": "number"}],
          "preprocessing": {"split": {"type": "fixed"}},
          "combiner": {"type": "concat", "fc_size": 14},
          "trainer": {"batch_size": 8, "epochs": 1},
      }
  
      ludwig.datasets._get_dataset_configs.cache_clear()
      with mock.patch(
          "ludwig.datasets._load_dataset_config", return_value=config
      ):
          with mock.patch(
              "ludwig.datasets.loaders.dataset_loader.get_default_cache_location",
              return_value=str(tmpdir),
          ):
              model = LudwigModel(model_config, backend="local")
  
              results = model.train(dataset=f"ludwig://{dataset_name}")
              proc_result = results.preprocessed_data
              train_df1 = proc_result.training_set.to_df()
              val_df1 = proc_result.validation_set.to_df()
              test_df1 = proc_result.test_set.to_df()
  
              assert len(train_df1) == 7
              assert len(val_df1) == 1
              assert len(test_df1) == 2
  
              results = model.train(
                  training_set=f"ludwig://{dataset_name}",
                  validation_set=f"ludwig://{dataset_name}",
                  test_set=f"ludwig://{dataset_name}",
              )
              proc_result_split = results.preprocessed_data
              train_df2 = proc_result_split.training_set.to_df()
              val_df2 = proc_result_split.validation_set.to_df()
              test_df2 = proc_result_split.test_set.to_df()
  
              assert len(train_df2) == 7
              assert len(val_df2) == 1
              assert len(test_df2) == 2
  
              sort_col = train_df1.columns[-1]
  
              def sort_df(df):
                  return df.sort_values(by=[sort_col]).reset_index(
                      drop=True
                  )
  
              assert sort_df(train_df1).equals(sort_df(train_df2))
              assert sort_df(val_df1).equals(sort_df(val_df2))
              assert sort_df(test_df1).equals(sort_df(test_df2))
  
      ludwig.datasets._get_dataset_configs.cache_clear()
  
file_path: ludwig/tests/ludwig/datasets/test_datasets.py
imports: import io
  import os
  import uuid
  from unittest import mock
  import pandas
  import pytest
  import ludwig.datasets
  from ludwig.api import LudwigModel
  from ludwig.datasets.dataset_config import DatasetConfig
  from ludwig.datasets.loaders.dataset_loader import DatasetState
  from tests.integration_tests.utils import private_test
label_desc: Use image node_id 5 for calling a global function with example usage: test_train_dataset_uri(tmpdir) and returns: df