class_docstr: A PyTorch-Lightning DataModule module supporting all the dataloaders
  in PyTorchVideo for different phases (train, validation and testing) of
  Lightning tranining.
  
  Supports loading any aribtrary iterable and map-style PyTorchVideo dataset
  upon following the config schema detailed below.
  
  Args:
      dataloader (DataLoaderConf):
          An OmegaConf / Hydra Config object consisting of dataloder
          config for each phase i.e, train, val and test.
  
          The Hydra schema for this config is as defined in
          `pytorchvideo_trainer.datamodule.datamodule.DataLoaderConf`
  
          One such example config can be found at
          `pytorchvideo_trainer/conf/datamodule/dataloader/kinetics_classification.yaml`
  
      transforms (TransformsConf):
          An OmegaConf / Hydra Config object consisting of transforms
          config for each phase i.e, train, val and test.
  
          The Hydra schema for this config is as defined in
          `pytorchvideo_trainer.datamodule.datamodule.TransformsConf`
  
          One such example config used for Resnet50 video model traning can be found at
          `pytorchvideo_trainer/conf/datamodule/transforms/kinetics_classification_slow.yaml`
code: def _get_dataloader(self, phase: str) -> DataLoader:
      assert (
          self.datasets[phase] is not None
      ), "Failed to get the {} dataset!".format(phase)
  
      if isinstance(
          self.datasets[phase], torch.utils.data.IterableDataset
      ):
          return torch.utils.data.DataLoader(
              self.datasets[phase],
              batch_size=self.config[phase].batch_size,
              num_workers=self.config[phase].num_workers,
              pin_memory=self.config[phase].pin_memory,
              drop_last=self.config[phase].drop_last,
              collate_fn=hydra.utils.instantiate(
                  self.config[phase].collate_fn
              ),
              worker_init_fn=hydra.utils.instantiate(
                  self.config[phase].worker_init_fn
              ),
          )
      else:
          sampler = None
          if (
              torch.distributed.is_available()
              and torch.distributed.is_initialized()
          ):
              logging.info(
                  "Distributed Environmnet detected, using DistributedSampler for dataloader."
              )
              sampler = DistributedSampler(self.datasets[phase])
  
          return torch.utils.data.DataLoader(
              self.datasets[phase],
              batch_size=self.config[phase].batch_size,
              num_workers=self.config[phase].num_workers,
              pin_memory=self.config[phase].pin_memory,
              drop_last=self.config[phase].drop_last,
              sampler=sampler,
              shuffle=(
                  False if sampler else self.config[phase].shuffle
              ),
              collate_fn=hydra.utils.instantiate(
                  self.config[phase].collate_fn
              ),
              worker_init_fn=hydra.utils.instantiate(
                  self.config[phase].worker_init_fn
              ),
          )
  
imports: from __future__ import annotations
  import logging
  from dataclasses import dataclass
  from typing import Any, Callable, Dict, List, Optional
  import hydra
  import pytorch_lightning
  import pytorchvideo.data
  import torch
  from hydra.core.config_store import ConfigStore
  from omegaconf import MISSING
  from pytorchvideo_trainer.datamodule.transforms import build_transforms
  from torch.utils.data import DataLoader, RandomSampler
  from torch.utils.data.distributed import DistributedSampler
  from torchrecipes.core.conf import DataModuleConf
  from torchrecipes.utils.config_utils import get_class_name_str
label_desc: Use image node_id 6 for calling the PyTorchVideoDataModule obj's underlying member method code with example usage: obj._get_dataloader(phase) and returns: torch, torch