class_docstr: Implements a dataset folder.
  
  DatasetFolder based on torchvisions implementation.
  (https://pytorch.org/docs/stable/torchvision/datasets.html#datasetfolder)
  
  Attributes:
      root:
          Root directory path
      loader:
          Function that loads file at path
      extensions:
          Tuple of allowed extensions
      transform:
          Function that takes a PIL image and returns transformed version
      target_transform:
          As transform but for targets
      is_valid_file:
          Used to check corrupt files
  
  Raises:
      RuntimeError: If no supported files are found in root.
code: def __init__(
      self,
      root: str,
      loader=default_loader,
      extensions=None,
      transform=None,
      target_transform=None,
      is_valid_file=None,
  ):
      super(DatasetFolder, self).__init__(
          root, transform=transform, target_transform=target_transform
      )
  
      samples = _make_dataset(self.root, extensions, is_valid_file)
      if len(samples) == 0:
          msg = "Found 0 files in folder: {}\n".format(self.root)
          if extensions is not None:
              msg += "Supported extensions are: {}".format(
                  ",".join(extensions)
              )
          raise RuntimeError(msg)
  
      self.loader = loader
      self.extensions = extensions
  
      self.samples = samples
      self.targets = [s[1] for s in samples]
  
file_path: lightly/lightly/data/_image.py
imports: import os
  from typing import List, Set, Tuple
  import torchvision.datasets
  from torchvision import transforms
  from lightly.data._image_loaders import default_loader
label_desc: Use image node_id 1 to create a new DatasetFolder object from inherited base classes: datasets with example: obj = DatasetFolder(root, loader, extensions, transform, target_transform, is_valid_file)