class_docstr: Standard MNIST, train, val, test splits and transforms.
  
  >>> MNISTDataModule()  # doctest: +ELLIPSIS
  <...mnist_datamodule.MNISTDataModule object at ...>
class_docstr_tok: ["Standard","MNIST",",","train",",","val",",","test","splits","and","transforms",".",">",">",">","MNISTDataModule","(",")","#","doctest",":","+ELLIPSIS","<","...","mnist_datamodule.MNISTDataModule","object","at","...",">"]
docstr: Args:
      data_dir: where to save/load the data
      val_split: how many of the training images to use for the validation split
      num_workers: how many workers to use for loading data
      normalize: If true applies image normalize
      seed: starting seed for RNG.
      batch_size: desired batch size.
docstr_tok: ["Args",":","data_dir",":","where","to","save\/load","the","data","val_split",":","how","many","of","the","training","images","to","use","for","the","validation","split","num_workers",":","how","many","workers","to","use","for","loading","data","normalize",":","If","true","applies","image","normalize","seed",":","starting","seed","for","RNG",".","batch_size",":","desired","batch","size","."]
code: def __init__(
      self,
      data_dir: str = _DATASETS_PATH,
      val_split: int = 5000,
      num_workers: int = 16,
      normalize: bool = False,
      seed: int = 42,
      batch_size: int = 32,
  ) -> None:
      """
      Args:
          data_dir: where to save/load the data
          val_split: how many of the training images to use for the validation split
          num_workers: how many workers to use for loading data
          normalize: If true applies image normalize
          seed: starting seed for RNG.
          batch_size: desired batch size.
      """
      super().__init__()
      if num_workers and _IS_WINDOWS:
          # see: https://stackoverflow.com/a/59680818
          warn(
              f"You have requested num_workers={num_workers} on Windows,"
              " but currently recommended is 0, so we set it for you"
          )
          num_workers = 0
  
      self.data_dir = data_dir
      self.val_split = val_split
      self.num_workers = num_workers
      self.normalize = normalize
      self.seed = seed
      self.batch_size = batch_size
  
imports: import logging
  import os
  import random
  import time
  import urllib
  from typing import Any, Callable, Optional, Sized, Tuple, Union
  from urllib.error import HTTPError
  from warnings import warn
  import torch
  from torch import Tensor
  from torch.utils.data import DataLoader, Dataset, random_split
  from lightning.fabric.utilities.imports import _IS_WINDOWS
  from lightning.pytorch import LightningDataModule
  from lightning.pytorch.utilities.imports import _TORCHVISION_AVAILABLE
label_desc: Use image node_id 1 to create a new MNISTDataModule object from inherited base classes: LightningDataModule with example: obj = MNISTDataModule(data_dir, val_split, num_workers, normalize, seed, batch_size)