class_docstr: Base class for a downloadable dataset consisting of a single archive file.
  
  It is recommended to extend this class if a dataset can be downloaded from
  the internet as a single archive. For multi-file implementation or if
  a more fine-grained control is required, consider extending
  :class:`DownloadableDataset` instead.
  
  This is a simplified version of :class:`DownloadableDataset` where the
  following assumptions must hold:
  - The dataset is made of a single archive.
  - The archive must be extracted to the root folder "as is" (which means
      that no subdirectories must be created).
  
  The child class is only required to extend the `_load_metadata` method,
  which must check the dataset integrity and load the dataset metadata.
  
  Apart from that, the same assumptions of :class:`DownloadableDataset` hold.
  Remember to call the `_load_dataset` method in the child class constructor.
class_docstr_tok: ["Base","class","for","a","downloadable","dataset","consisting","of","a","single","archive","file",".","It","is","recommended","to","extend","this","class","if","a","dataset","can","be","downloaded","from","the","internet","as","a","single","archive",".","For","multi-file","implementation","or","if","a","more","fine-grained","control","is","required",",","consider","extending",":","class",":","`","DownloadableDataset","`","instead",".","This","is","a","simplified","version","of",":","class",":","`","DownloadableDataset","`","where","the","following","assumptions","must","hold",":","-","The","dataset","is","made","of","a","single","archive",".","-","The","archive","must","be","extracted","to","the","root","folder","``","as","is","''","(","which","means","that","no","subdirectories","must","be","created",")",".","The","child","class","is","only","required","to","extend","the","`","_load_metadata","`","method",",","which","must","check","the","dataset","integrity","and","load","the","dataset","metadata",".","Apart","from","that",",","the","same","assumptions","of",":","class",":","`","DownloadableDataset","`","hold",".","Remember","to","call","the","`","_load_dataset","`","method","in","the","child","class","constructor","."]
docstr: Creates an instance of a simple downloadable dataset.
  
  Consider looking at the class documentation for the precise details on
  how to extend this class.
  
  Beware that calling this constructor only fills the `root` field. The
  download and metadata loading procedures are triggered only by
  calling `_load_dataset`.
  
  :param root_or_dataset_name: The root path where the dataset will be
      downloaded. If a directory name is passed, then the root obtained by
      calling `default_dataset_location` will be used (recommended).
      To check if this parameter is a path, the constructor will check if
      it contains the '' or '/' characters or if it is a Path instance.
  :param url: The url of the archive.
  :param checksum: The MD5 hash to use when verifying the downloaded
      archive. Can be None, in which case the check will be skipped.
      It is recommended to always fill this parameter.
  :param download: If True, the dataset will be downloaded if needed.
      If False and the dataset can't be loaded from the provided root
      path, an error will be raised when calling the `_load_dataset`
      method. Defaults to False.
  :param verbose: If True, some info about the download process will be
      printed. Defaults to False.
docstr_tok: ["Creates","an","instance","of","a","simple","downloadable","dataset",".","Consider","looking","at","the","class","documentation","for","the","precise","details","on","how","to","extend","this","class",".","Beware","that","calling","this","constructor","only","fills","the","`","root","`","field",".","The","download","and","metadata","loading","procedures","are","triggered","only","by","calling","`","_load_dataset","`",".",":","param","root_or_dataset_name",":","The","root","path","where","the","dataset","will","be","downloaded",".","If","a","directory","name","is","passed",",","then","the","root","obtained","by","calling","`","default_dataset_location","`","will","be","used","(","recommended",")",".","To","check","if","this","parameter","is","a","path",",","the","constructor","will","check","if","it","contains","the","``","or","'\/","'","characters","or","if","it","is","a","Path","instance",".",":","param","url",":","The","url","of","the","archive",".",":","param","checksum",":","The","MD5","hash","to","use","when","verifying","the","downloaded","archive",".","Can","be","None",",","in","which","case","the","check","will","be","skipped",".","It","is","recommended","to","always","fill","this","parameter",".",":","param","download",":","If","True",",","the","dataset","will","be","downloaded","if","needed",".","If","False","and","the","dataset","ca","n't","be","loaded","from","the","provided","root","path",",","an","error","will","be","raised","when","calling","the","`","_load_dataset","`","method",".","Defaults","to","False",".",":","param","verbose",":","If","True",",","some","info","about","the","download","process","will","be","printed",".","Defaults","to","False","."]
code: def __init__(
      self,
      root_or_dataset_name: Union[str, Path],
      url: str,
      checksum: Optional[str],
      download: bool = False,
      verbose: bool = False,
  ):
      """
      Creates an instance of a simple downloadable dataset.
  
      Consider looking at the class documentation for the precise details on
      how to extend this class.
  
      Beware that calling this constructor only fills the `root` field. The
      download and metadata loading procedures are triggered only by
      calling `_load_dataset`.
  
      :param root_or_dataset_name: The root path where the dataset will be
          downloaded. If a directory name is passed, then the root obtained by
          calling `default_dataset_location` will be used (recommended).
          To check if this parameter is a path, the constructor will check if
          it contains the '\' or '/' characters or if it is a Path instance.
      :param url: The url of the archive.
      :param checksum: The MD5 hash to use when verifying the downloaded
          archive. Can be None, in which case the check will be skipped.
          It is recommended to always fill this parameter.
      :param download: If True, the dataset will be downloaded if needed.
          If False and the dataset can't be loaded from the provided root
          path, an error will be raised when calling the `_load_dataset`
          method. Defaults to False.
      :param verbose: If True, some info about the download process will be
          printed. Defaults to False.
      """
  
      self.url = url
      self.checksum = checksum
  
      if (
          isinstance(root_or_dataset_name, Path)
          or "/" in root_or_dataset_name
          or "\\" in root_or_dataset_name
      ):
          root = Path(root_or_dataset_name)
      else:
          root = default_dataset_location(root_or_dataset_name)
  
      super(SimpleDownloadableDataset, self).__init__(
          root, download=download, verbose=verbose
      )
  
imports: from abc import abstractmethod, ABC
  from pathlib import Path
  from typing import TypeVar, Union, Optional
  import shutil
  import os
  from torch.utils.data.dataset import Dataset
  from torchvision.datasets.utils import download_and_extract_archive, extract_archive, download_url, check_integrity
  from avalanche.benchmarks.datasets.dataset_utils import default_dataset_location
label_desc: Use image node_id 1 to create a new SimpleDownloadableDataset object from inherited base classes: DownloadableDataset, ABC with example: obj = SimpleDownloadableDataset(root_or_dataset_name, url, checksum, download, verbose)