code: def __init__(
      self,
      dataset=None,
      bs=None,
      num_workers=0,
      pin_memory=False,
      timeout=0,
      batch_size=None,
      shuffle=False,
      drop_last=False,
      indexed=None,
      n=None,
      device=None,
      persistent_workers=False,
      pin_memory_device="",
      **kwargs,
  ):
      if batch_size is not None:
          bs = batch_size  # PyTorch compatibility
      assert not (bs is None and drop_last)
      if indexed is None:
          indexed = hasattr(dataset, "__getitem__") and not isinstance(
              dataset, IterableDataset
          )
      if not indexed and shuffle:
          raise ValueError(
              "Can only shuffle an indexed dataset (not an iterable one)."
          )
      if n is None:
          try:
              n = len(dataset)
          except TypeError:
              pass
      store_attr(
          "dataset,bs,shuffle,drop_last,indexed,n,pin_memory,timeout,device"
      )
      self.rng, self.num_workers, self.offs = (
          random.Random(random.randint(0, 2**32 - 1)),
          1,
          0,
      )
      if sys.platform == "win32" and IN_NOTEBOOK and num_workers > 0:
          num_workers = 0
      if sys.platform == "darwin" and num_workers > 0:
          num_workers = 0
      self.fake_l = _FakeLoader(
          self,
          pin_memory,
          num_workers,
          timeout,
          persistent_workers=persistent_workers,
          pin_memory_device=pin_memory_device,
      )
  
imports: from __future__ import annotations
  from ..torch_basics import *
  from torch.utils.data.dataloader import _MultiProcessingDataLoaderIter, _SingleProcessDataLoaderIter, _DatasetKind
label_desc: Use image node_id 1 to create a new DataLoader object from inherited base classes: GetAttr with example: obj = DataLoader(dataset, bs, num_workers, pin_memory, timeout, batch_size, shuffle, drop_last, indexed, n, device, persistent_workers, pin_memory_device)