code: def _create_dataloader(
      self,
      batch_size,
      r,
      bgs,
      dataset_config,
      start_by_longest=False,
      preprocess_samples=False,
  ):
      # load dataset
      meta_data_train, meta_data_eval = load_tts_samples(
          dataset_config, eval_split=True, eval_split_size=0.2
      )
      items = meta_data_train + meta_data_eval
      tokenizer, _ = TTSTokenizer.init_from_config(c)
      dataset = TTSDataset(
          outputs_per_step=r,
          compute_linear_spec=True,
          return_wav=True,
          tokenizer=tokenizer,
          ap=self.ap,
          samples=items,
          batch_group_size=bgs,
          min_text_len=c.min_text_len,
          max_text_len=c.max_text_len,
          min_audio_len=c.min_audio_len,
          max_audio_len=c.max_audio_len,
          start_by_longest=start_by_longest,
      )
  
      # add preprocess to force the length computation
      if preprocess_samples:
          dataset.preprocess_samples()
  
      dataloader = DataLoader(
          dataset,
          batch_size=batch_size,
          shuffle=False,
          collate_fn=dataset.collate_fn,
          drop_last=True,
          num_workers=c.num_loader_workers,
      )
      return dataloader, dataset
  
file_path: TTS/tests/data_tests/test_loader.py
imports: import os
  import shutil
  import unittest
  import numpy
  import torch
  from torch.utils.data import DataLoader
  from tests import get_tests_data_path, get_tests_output_path
  from TTS.tts.configs.shared_configs import BaseDatasetConfig, BaseTTSConfig
  from TTS.tts.datasets import TTSDataset, load_tts_samples
  from TTS.tts.utils.text.tokenizer import TTSTokenizer
  from TTS.utils.audio import AudioProcessor
label_desc: Use image node_id 2 for calling the TestTTSDataset obj's underlying member method code with example usage: obj._create_dataloader(batch_size, r, bgs, dataset_config, start_by_longest, preprocess_samples) and returns: dataloader,  dataset