class_docstr: `German Traffic Sign Recognition Benchmark (GTSRB) <https://benchmark.ini.rub.de/>`_ Dataset.
  
  Args:
      root (string): Root directory of the dataset.
      split (string, optional): The dataset split, supports ``"train"`` (default), or ``"test"``.
      transform (callable, optional): A function/transform that takes in a PIL image and returns a transformed
          version. E.g, ``transforms.RandomCrop``.
      target_transform (callable, optional): A function/transform that takes in the target and transforms it.
      download (bool, optional): If True, downloads the dataset from the internet and
          puts it in root directory. If dataset is already downloaded, it is not
          downloaded again.
code: def __init__(
      self,
      root: str,
      split: str = "train",
      transform: Optional[Callable] = None,
      target_transform: Optional[Callable] = None,
      download: bool = False,
  ) -> None:
      super().__init__(
          root, transform=transform, target_transform=target_transform
      )
  
      self._split = verify_str_arg(split, "split", ("train", "test"))
      self._base_folder = pathlib.Path(root) / "gtsrb"
      self._target_folder = (
          self._base_folder
          / "GTSRB"
          / (
              "Training"
              if self._split == "train"
              else "Final_Test/Images"
          )
      )
  
      if download:
          self.download()
  
      if not self._check_exists():
          raise RuntimeError(
              "Dataset not found. You can use download=True to download it"
          )
  
      if self._split == "train":
          samples = make_dataset(
              str(self._target_folder), extensions=(".ppm",)
          )
      else:
          with open(
              self._base_folder / "GT-final_test.csv"
          ) as csv_file:
              samples = [
                  (
                      str(self._target_folder / row["Filename"]),
                      int(row["ClassId"]),
                  )
                  for row in csv.DictReader(
                      csv_file, delimiter=";", skipinitialspace=True
                  )
              ]
  
      self._samples = samples
      self.transform = transform
      self.target_transform = target_transform
  
file_path: vision/torchvision/datasets/gtsrb.py
imports: import csv
  import pathlib
  from typing import Any, Callable, Optional, Tuple
  import PIL
  from .folder import make_dataset
  from .utils import download_and_extract_archive, verify_str_arg
  from .vision import VisionDataset
label_desc: Use image node_id 1 to create a new GTSRB object from inherited base classes: VisionDataset with example: obj = GTSRB(root, split, transform, target_transform, download)