code: def create_dataset(
      local_rank,
      dataset_name,
      data_split,
      output_path,
      train_phase,
      seed,
      tokenizer,
      end_of_conversation_token,
      max_seq_len,
      rebuild,
  ):
      raw_dataset = get_raw_dataset(
          dataset_name, output_path, seed, local_rank
      )
      train_dataset = raw_dataset.get_train_data()
      train_index = get_raw_dataset_split_index(
          local_rank,
          output_path,
          raw_dataset.dataset_name_clean,
          seed,
          "train",
          data_split,
          train_phase - 1,
          len(train_dataset),
          rebuild,
      )
      train_dataset = Subset(train_dataset, train_index)
      train_dataset = create_dataset_split(
          train_dataset,
          raw_dataset,
          train_phase,
          tokenizer,
          end_of_conversation_token,
          max_seq_len,
      )
  
      eval_dataset = raw_dataset.get_eval_data()
      eval_index = get_raw_dataset_split_index(
          local_rank,
          output_path,
          raw_dataset.dataset_name_clean,
          seed,
          "eval",
          data_split,
          train_phase - 1,
          len(eval_dataset),
          rebuild,
      )
      eval_dataset = Subset(eval_dataset, eval_index)
      eval_dataset = create_dataset_split(
          eval_dataset,
          raw_dataset,
          train_phase,
          tokenizer,
          end_of_conversation_token,
          max_seq_len,
      )
      return train_dataset, eval_dataset
  
imports: import torch
  from torch.utils.data import Dataset, Subset, ConcatDataset
  from torch.nn.utils.rnn import pad_sequence
  import torch.nn.functional
  from datasets import load_dataset
  import numpy
  import os
  import hashlib
  from itertools import chain
  from dschat.utils.data import raw_datasets
  from deepspeed.accelerator import get_accelerator
label_desc: Use image node_id 5 for calling a global function with example usage: create_dataset(local_rank, dataset_name, data_split, output_path, train_phase, seed, tokenizer, end_of_conversation_token, max_seq_len, rebuild) and returns: train_dataset,  eval_dataset