docstr: Train/validation loaders.
code: def __dataloader(
      self, train: bool, batch_size=None, limit_num_samples=None
  ):
      """Train/validation loaders."""
      if batch_size is None:
          batch_size = self._batch_size
      if train:
          dataset = self.create_dataset(
              self.data_path.joinpath("train"), self.train_transform
          )
          return DataLoader(
              dataset=dataset,
              batch_size=batch_size,
              num_workers=self._num_workers,
              shuffle=True,
          )
      else:
          dataset = self.create_dataset(
              self.data_path.joinpath("validation"),
              self.valid_transform,
          )
          if limit_num_samples is not None:
              indices = np.random.permutation(len(dataset))[
                  :limit_num_samples
              ]
              dataset = Subset(dataset, indices)
          return DataLoader(
              dataset=dataset,
              batch_size=batch_size,
              num_workers=self._num_workers,
              shuffle=False,
          )
  
imports: import logging
  from pathlib import Path
  from typing import Union
  import numpy
  import torch
  import torch.nn.functional
  from torch import nn, optim
  from torch.optim.lr_scheduler import MultiStepLR
  from torch.optim.optimizer import Optimizer
  from torch.utils.data import DataLoader, Subset
  from torchmetrics.classification import MulticlassAccuracy
  from torchvision import models, transforms
  from torchvision.datasets import ImageFolder
  from torchvision.datasets.utils import download_and_extract_archive
  from pytorch_lightning import LightningDataModule, LightningModule
  from pytorch_lightning.callbacks.finetuning import BaseFinetuning
  from pytorch_lightning.utilities.rank_zero import rank_zero_info
label_desc: Use image node_id 8 for calling the CatDogImageDataModule obj's underlying member method code with example usage: obj.__dataloader(train, batch_size, limit_num_samples) and returns: DataLoader, DataLoader