code: def setup_loader(ap, is_val=False, verbose=False):
      if is_val and not c.run_eval:
          loader = None
      else:
          dataset = GANDataset(
              ap=ap,
              items=eval_data if is_val else train_data,
              seq_len=c.seq_len,
              hop_len=ap.hop_length,
              pad_short=c.pad_short,
              conv_pad=c.conv_pad,
              is_training=not is_val,
              return_segments=not is_val,
              use_noise_augment=c.use_noise_augment,
              use_cache=c.use_cache,
              verbose=verbose,
          )
          dataset.shuffle_mapping()
          sampler = (
              DistributedSampler(dataset, shuffle=True)
              if num_gpus > 1
              else None
          )
          loader = DataLoader(
              dataset,
              batch_size=1 if is_val else c.batch_size,
              shuffle=False if num_gpus > 1 else True,
              drop_last=False,
              sampler=sampler,
              num_workers=c.num_val_loader_workers
              if is_val
              else c.num_loader_workers,
              pin_memory=False,
          )
      return loader
  
imports: import argparse
  import glob
  import os
  import sys
  import time
  import traceback
  from inspect import signature
  import torch
  from torch.utils.data import DataLoader
  from TTS.utils.audio import AudioProcessor
  from TTS.utils.console_logger import ConsoleLogger
  from TTS.utils.generic_utils import KeepAverage, count_parameters, create_experiment_folder, get_git_branch, remove_experiment_folder, set_init_dict
  from TTS.utils.io import copy_model_files, load_config
  from TTS.utils.radam import RAdam
  from TTS.utils.tensorboard_logger import TensorboardLogger
  from TTS.utils.training import setup_torch_training_env
  from TTS.vocoder.datasets.gan_dataset import GANDataset
  from TTS.vocoder.datasets.preprocess import load_wav_data, load_wav_feat_data
  from TTS.vocoder.layers.losses import DiscriminatorLoss, GeneratorLoss
  from TTS.vocoder.utils.generic_utils import plot_results, setup_discriminator, setup_generator
  from TTS.vocoder.utils.io import save_best_model, save_checkpoint
  from torch.nn.parallel import DistributedDataParallel
  from torch.utils.data.distributed import DistributedSampler
  from TTS.utils.distribute import init_distributed
label_desc: Use image node_id 1 for calling a global function with example usage: setup_loader(ap, is_val, verbose) and returns: loader