code: def get_loaders(
      dataset,
      train_envs,
      batch_size,
      val_envs=None,
      test_envs=None,
      class_balanced=False,
      holdout_fraction=0.2,
      trial_seed=0,
  ):
      """Return training, validation, and test dataloaders.
  
      :param dataset: dataset class containing list of environments
      :param train_envs: list containing indices of training domains in the dataset
      :param batch_size: Value of batch size to be used for dataloaders
      :param val_envs: list containing indices of validation domains in the dataset. If None, fraction of training data (`holdout_fraction`) is used to create validation set.
      :param test_envs: list containing indices of test domains in the dataset
      :param class_balanced: Binary flag indicating whether balanced sampling is to be done between classes
      :param holdout_fraction: fraction of training data used for creating validation domains. This is used when `val_envs` is None.
      :param trial_seed: seed used for generating validation split from training data. This is used when `val_envs` is None.
  
      :returns: dictionary of list of dataloaders in the format
          {'train_loaders': [train_dataloader_1, train_dataloader_2, ....],
           'val_loaders': [val_dataloader_1, val_dataloader_2, ....],
           'test_loaders': [test_dataloader_1, test_dataloader_2, ....]
          }
      """
  
      loaders = {}
  
      if (
          val_envs
      ):  # use validation environment to initialize val_loaders
          loaders["train_loaders"] = get_train_loader(
              dataset, train_envs, batch_size, class_balanced
          )
          loaders["val_loaders"] = get_eval_loader(
              dataset, val_envs, batch_size, class_balanced
          )
  
      else:  # use subset of training data to initialize val_loaders
          (
              loaders["train_loaders"],
              loaders["val_loaders"],
          ) = get_train_eval_loader(
              dataset,
              train_envs,
              batch_size,
              class_balanced,
              holdout_fraction,
              trial_seed,
          )
  
      if test_envs:
          loaders["test_loaders"] = get_eval_loader(
              dataset, test_envs, batch_size, class_balanced
          )
  
      return loaders
  
imports: from dowhy.causal_prediction.dataloaders import misc
  from dowhy.causal_prediction.dataloaders.fast_data_loader import FastDataLoader, InfiniteDataLoader
label_desc: Use image node_id 4 for calling a global function with example usage: get_loaders(dataset, train_envs, batch_size, val_envs, test_envs, class_balanced, holdout_fraction, trial_seed) and returns: loaders