code: def split_dataset(items):
      speakers = [item[-1] for item in items]
      is_multi_speaker = len(set(speakers)) > 1
      eval_split_size = min(500, int(len(items) * 0.01))
      assert (
          eval_split_size > 0
      ), " [!] You do not have enough samples to train. You need at least 100 samples."
      np.random.seed(0)
      np.random.shuffle(items)
      if is_multi_speaker:
          items_eval = []
          speakers = [item[-1] for item in items]
          speaker_counter = Counter(speakers)
          while len(items_eval) < eval_split_size:
              item_idx = np.random.randint(0, len(items))
              speaker_to_be_removed = items[item_idx][-1]
              if speaker_counter[speaker_to_be_removed] > 1:
                  items_eval.append(items[item_idx])
                  speaker_counter[speaker_to_be_removed] -= 1
                  del items[item_idx]
          return items_eval, items
      return items[:eval_split_size], items[eval_split_size:]
  
file_path: TTS/TTS/tts/utils/generic_utils.py
imports: import re
  import torch
  import importlib
  import numpy
  from collections import Counter
  from TTS.utils.generic_utils import check_argument
label_desc: Use image node_id 1 for calling a global function with example usage: split_dataset(items) and returns: items,  items, items_eval,  items