code: def get_train_val_loaders(
      root_path,
      train_transforms,
      val_transforms,
      batch_size=16,
      num_workers=8,
      train_sampler=None,
      val_batch_size=None,
      sbd_path=None,
      limit_train_num_samples=None,
      limit_val_num_samples=None,
  ):
      train_ds = get_train_dataset(root_path)
      val_ds = get_val_dataset(root_path)
  
      if sbd_path is not None:
          sbd_train_ds = get_train_noval_sbdataset(sbd_path)
          train_ds = train_ds + sbd_train_ds
  
      if len(val_ds) < len(train_ds):
          g = torch.Generator().manual_seed(len(train_ds))
          train_eval_indices = torch.randperm(
              len(train_ds), generator=g
          )[: len(val_ds)]
          train_eval_ds = Subset(train_ds, train_eval_indices)
      else:
          train_eval_ds = train_ds
  
      train_ds = TransformedDataset(
          train_ds, transform_fn=train_transforms
      )
      val_ds = TransformedDataset(val_ds, transform_fn=val_transforms)
      train_eval_ds = TransformedDataset(
          train_eval_ds, transform_fn=val_transforms
      )
  
      val_batch_size = (
          batch_size * 4 if val_batch_size is None else val_batch_size
      )
  
      train_loader = get_dataloader(
          train_ds,
          shuffle=True,
          sampler=train_sampler,
          batch_size=batch_size,
          num_workers=num_workers,
          drop_last=True,
          limit_num_samples=limit_train_num_samples,
      )
  
      val_loader = get_dataloader(
          val_ds,
          shuffle=False,
          batch_size=val_batch_size,
          num_workers=num_workers,
          drop_last=False,
          limit_num_samples=limit_val_num_samples,
      )
  
      train_eval_loader = get_dataloader(
          train_eval_ds,
          shuffle=False,
          batch_size=val_batch_size,
          num_workers=num_workers,
          drop_last=False,
          limit_num_samples=limit_val_num_samples,
      )
  
      return train_loader, val_loader, train_eval_loader
  
imports: import cv2
  import numpy
  import torch
  from PIL import Image
  from torch.utils.data import Dataset
  from torch.utils.data.dataset import Subset
  from torchvision.datasets.sbd import SBDataset
  from torchvision.datasets.voc import VOCSegmentation
  import ignite.distributed
  from ignite.utils import convert_tensor
label_desc: Use image node_id 5 for calling a global function with example usage: get_train_val_loaders(root_path, train_transforms, val_transforms, batch_size, num_workers, train_sampler, val_batch_size, sbd_path, limit_train_num_samples, limit_val_num_samples) and returns: train_loader,  val_loader,  train_eval_loader