code: def create_dataset(config):
      """Create dataset according to :attr:`config['model']` and :attr:`config['MODEL_TYPE']`.
      If :attr:`config['dataset_save_path']` file exists and
      its :attr:`config` of dataset is equal to current :attr:`config` of dataset.
      It will return the saved dataset in :attr:`config['dataset_save_path']`.
  
      Args:
          config (Config): An instance object of Config, used to record parameter information.
  
      Returns:
          Dataset: Constructed dataset.
      """
      dataset_module = importlib.import_module("recbole.data.dataset")
      if hasattr(dataset_module, config["model"] + "Dataset"):
          dataset_class = getattr(
              dataset_module, config["model"] + "Dataset"
          )
      else:
          model_type = config["MODEL_TYPE"]
          type2class = {
              ModelType.GENERAL: "Dataset",
              ModelType.SEQUENTIAL: "SequentialDataset",
              ModelType.CONTEXT: "Dataset",
              ModelType.KNOWLEDGE: "KnowledgeBasedDataset",
              ModelType.TRADITIONAL: "Dataset",
              ModelType.DECISIONTREE: "Dataset",
          }
          dataset_class = getattr(
              dataset_module, type2class[model_type]
          )
  
      default_file = os.path.join(
          config["checkpoint_dir"],
          f'{config["dataset"]}-{dataset_class.__name__}.pth',
      )
      file = config["dataset_save_path"] or default_file
      if os.path.exists(file):
          with open(file, "rb") as f:
              dataset = pickle.load(f)
          dataset_args_unchanged = True
          for arg in dataset_arguments + ["seed", "repeatable"]:
              if config[arg] != dataset.config[arg]:
                  dataset_args_unchanged = False
                  break
          if dataset_args_unchanged:
              logger = getLogger()
              logger.info(
                  set_color("Load filtered dataset from", "pink")
                  + f": [{file}]"
              )
              return dataset
  
      dataset = dataset_class(config)
      if config["save_dataset"]:
          dataset.save()
      return dataset
  
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 1 for calling a global function with example usage: create_dataset(config) and returns: dataset, dataset