code: def make_dataloader(
      dataset, looped_nominal_epoch=None, **loader_kwargs
  ):
      """Makes a basic DataLoader with SpeechBrain defaults.
  
      For DynamicItemDatasets (which return dicts), use
      PaddedBatch as the default collate_fn.
  
      Shuffling gets implemented by ReproducibleRandomSampler.
  
      If the Dataset is not an IterableDataset, the DataLoader
      is a SaveableDataLoader.
  
      If the Dataset is a webdataset.dataset.Composable, set default
      batch_size = None.
  
      Can also loop over the underlying dataloader continuously,
      and stop iterations at nominal epoch lengths.
  
      Arguments
      ---------
      dataset : Dataset
          The dataset to make a DataLoader for.
      looped_nominal_epoch : None, int
          If an integer is given, loop the underlying DataLoader infinitely and
          set a nominal epoch length in batches (or whatever the DataLoader
          yields).
      **loader_kwargs : dict
          Keyword args to DataLoader, see PyTorch DataLoader for
          options.
  
      Returns
      -------
      DataLoader
          If looped_nominal_epoch is None
      LoopedLoader
          If looped_nominal_epoch is not None
      """
      # PaddedBatch as default collation for DynamicItemDataset
      if "collate_fn" not in loader_kwargs and isinstance(
          dataset, DynamicItemDataset
      ):
          loader_kwargs["collate_fn"] = PaddedBatch
      # Reproducible random sampling
      if loader_kwargs.get("shuffle", False):
          if loader_kwargs.get("sampler") is not None:
              raise ValueError(
                  "Cannot specify both shuffle=True and a "
                  "sampler in loader_kwargs"
              )
          sampler = ReproducibleRandomSampler(dataset)
          loader_kwargs["sampler"] = sampler
          # Should delete shuffle because you can't set both Sampler and
          # shuffle
          # NOTE: the dict of loader options may get used elsewhere!
          # However, this del doesn't touch those because loader_kwargs comes
          # from a **kwargs dict.
          del loader_kwargs["shuffle"]
      # With WDS it is recommended to do batching in the dataset itself,
      # which requires batch_size = None in the DataLoader
      if (
          WDS_AVAILABLE
          and isinstance(dataset, WDS_CLASS)
          and "batch_size" not in loader_kwargs
      ):
          loader_kwargs["batch_size"] = None
      # Create the loader
      if isinstance(dataset, IterableDataset):
          dataloader = DataLoader(dataset, **loader_kwargs)
      else:
          dataloader = SaveableDataLoader(dataset, **loader_kwargs)
      if looped_nominal_epoch is not None:
          dataloader = LoopedLoader(dataloader, looped_nominal_epoch)
      return dataloader
  
imports: from torch.utils.data import DataLoader
  from torch.utils.data import IterableDataset
  from torch.utils.data.dataloader import _BaseDataLoaderIter
  import logging
  import warnings
  import functools
  from torch.utils.data import DistributedSampler
  from speechbrain.dataio.batch import PaddedBatch, BatchsizeGuesser
  from speechbrain.dataio.dataset import DynamicItemDataset
  from speechbrain.dataio.sampler import ReproducibleRandomSampler, DistributedSamplerWrapper
  from speechbrain.utils.checkpoints import register_checkpoint_hooks, mark_as_saver, mark_as_loader
label_desc: Use image node_id 2 for calling a global function with example usage: make_dataloader(dataset, looped_nominal_epoch) and returns: dataloader