code: def test_presplit_override(format, tmpdir):
      """Tests that provising a pre-split file or dataframe overrides the user's split config."""
      num_feat = number_feature(normalization=None)
      input_features = [
          num_feat,
          sequence_feature(encoder={"reduce_output": "sum"}),
      ]
      output_features = [
          category_feature(
              decoder={"vocab_size": 5}, reduce_input="sum"
          )
      ]
  
      data_csv = generate_data(
          input_features,
          output_features,
          os.path.join(tmpdir, "dataset.csv"),
          num_examples=25,
      )
      data_df = pd.read_csv(data_csv)
  
      # Set the feature value equal to an ordinal index so we can ensure the splits are identical before and after
      # preprocessing.
      data_df[num_feat[COLUMN]] = data_df.index
  
      train_df = data_df[:15]
      val_df = data_df[15:20]
      test_df = data_df[20:]
  
      train_data = train_df
      val_data = val_df
      test_data = test_df
  
      if format == "file":
          train_data = os.path.join(tmpdir, "train.csv")
          val_data = os.path.join(tmpdir, "val.csv")
          test_data = os.path.join(tmpdir, "test.csv")
  
          train_df.to_csv(train_data)
          val_df.to_csv(val_data)
          test_df.to_csv(test_data)
  
      data_df.to_csv(data_csv, index=False)
      config = {
          INPUT_FEATURES: input_features,
          OUTPUT_FEATURES: output_features,
          TRAINER: {
              EPOCHS: 2,
          },
          PREPROCESSING: {SPLIT: {TYPE: "random"}},
      }
  
      model = LudwigModel(config, backend=LocalTestBackend())
      train_set, val_set, test_set, _ = model.preprocess(
          training_set=train_data,
          validation_set=val_data,
          test_set=test_data,
      )
  
      assert len(train_set) == len(train_df)
      assert len(val_set) == len(val_df)
      assert len(test_set) == len(test_df)
  
      assert np.all(
          train_set.to_df()[num_feat[PROC_COLUMN]].values
          == train_df[num_feat[COLUMN]].values
      )
      assert np.all(
          val_set.to_df()[num_feat[PROC_COLUMN]].values
          == val_df[num_feat[COLUMN]].values
      )
      assert np.all(
          test_set.to_df()[num_feat[PROC_COLUMN]].values
          == test_df[num_feat[COLUMN]].values
      )
  
imports: import contextlib
  import copy
  import logging
  import os
  import random
  import string
  from unittest import mock
  import numpy
  import pandas
  import pytest
  from PIL import Image
  from transformers import AutoTokenizer
  import ludwig
  from ludwig.api import LudwigModel
  from ludwig.backend import initialize_backend
  from ludwig.callbacks import Callback
  from ludwig.constants import BASE_MODEL, BATCH_SIZE, COLUMN, DECODER, EPOCHS, FULL, INPUT_FEATURES, MODEL_ECD, MODEL_LLM, MODEL_TYPE, NAME, OUTPUT_FEATURES, PREPROCESSING, PROC_COLUMN, PROMPT, SPLIT, TRAINER, TYPE
  from ludwig.data.concatenate_datasets import concatenate_df
  from ludwig.data.preprocessing import handle_features_with_prompt_config, preprocess_for_prediction
  from ludwig.schema.llms.prompt import PromptConfig
  from ludwig.schema.model_types.base import ModelConfig
  from tests.integration_tests.utils import assert_preprocessed_dataset_shape_and_dtype_for_feature, audio_feature, binary_feature, category_feature, generate_data, generate_data_as_dataframe, image_feature, LocalTestBackend, number_feature, sequence_feature, text_feature
label_desc: Use image node_id 15 for calling a global function with example usage: test_presplit_override(format, tmpdir) without return types