code: def data_preparation(config, dataset):
      """Split the dataset by :attr:`config['[valid|test]_eval_args']` and create training, validation and test dataloader.
  
      Note:
          If we can load split dataloaders by :meth:`load_split_dataloaders`, we will not create new split dataloaders.
  
      Args:
          config (Config): An instance object of Config, used to record parameter information.
          dataset (Dataset): An instance object of Dataset, which contains all interaction records.
  
      Returns:
          tuple:
              - train_data (AbstractDataLoader): The dataloader for training.
              - valid_data (AbstractDataLoader): The dataloader for validation.
              - test_data (AbstractDataLoader): The dataloader for testing.
      """
      dataloaders = load_split_dataloaders(config)
      if dataloaders is not None:
          train_data, valid_data, test_data = dataloaders
          dataset._change_feat_format()
      else:
          model_type = config["MODEL_TYPE"]
          built_datasets = dataset.build()
  
          train_dataset, valid_dataset, test_dataset = built_datasets
          train_sampler, valid_sampler, test_sampler = create_samplers(
              config, dataset, built_datasets
          )
  
          if model_type != ModelType.KNOWLEDGE:
              train_data = get_dataloader(config, "train")(
                  config,
                  train_dataset,
                  train_sampler,
                  shuffle=config["shuffle"],
              )
          else:
              kg_sampler = KGSampler(
                  dataset,
                  config["train_neg_sample_args"]["distribution"],
                  config["train_neg_sample_args"]["alpha"],
              )
              train_data = get_dataloader(config, "train")(
                  config,
                  train_dataset,
                  train_sampler,
                  kg_sampler,
                  shuffle=True,
              )
  
          valid_data = get_dataloader(config, "valid")(
              config, valid_dataset, valid_sampler, shuffle=False
          )
          test_data = get_dataloader(config, "test")(
              config, test_dataset, test_sampler, shuffle=False
          )
          if config["save_dataloaders"]:
              save_split_dataloaders(
                  config,
                  dataloaders=(train_data, valid_data, test_data),
              )
  
      logger = getLogger()
      logger.info(
          set_color("[Training]: ", "pink")
          + set_color("train_batch_size", "cyan")
          + " = "
          + set_color(f'[{config["train_batch_size"]}]', "yellow")
          + set_color(" train_neg_sample_args", "cyan")
          + ": "
          + set_color(f'[{config["train_neg_sample_args"]}]', "yellow")
      )
      logger.info(
          set_color("[Evaluation]: ", "pink")
          + set_color("eval_batch_size", "cyan")
          + " = "
          + set_color(f'[{config["eval_batch_size"]}]', "yellow")
          + set_color(" eval_args", "cyan")
          + ": "
          + set_color(f'[{config["eval_args"]}]', "yellow")
      )
      return train_data, valid_data, test_data
  
file_path: RecBole/recbole/data/utils.py
imports: import copy
  import importlib
  import os
  import pickle
  import warnings
  from typing import Literal
  from recbole.data.dataloader import *
  from recbole.sampler import KGSampler, Sampler, RepeatableSampler
  from recbole.utils import ModelType, ensure_dir, get_local_time, set_color
  from recbole.utils.argument_list import dataset_arguments
label_desc: Use image node_id 4 for calling a global function with example usage: data_preparation(config, dataset) and returns: train_data,  valid_data,  test_data