class_docstr: Defines a dataset composed of Examples along with its Fields.
  
  Attributes:
      sort_key (callable): A key to use for sorting dataset examples for batching
          together examples with similar lengths to minimize padding.
      examples (list(Example)): The examples in this dataset.
          fields: A dictionary containing the name of each column together with
          its corresponding Field object. Two columns with the same Field
          object will share a vocabulary.
      fields (dict[str, Field]): Contains the name of each column or field, together
          with the corresponding Field object. Two fields with the same Field object
          will have a shared vocabulary.
class_docstr_tok: ["Defines","a","dataset","composed","of","Examples","along","with","its","Fields",".","Attributes",":","sort_key","(","callable",")",":","A","key","to","use","for","sorting","dataset","examples","for","batching","together","examples","with","similar","lengths","to","minimize","padding",".","examples","(","list","(","Example",")",")",":","The","examples","in","this","dataset",".","fields",":","A","dictionary","containing","the","name","of","each","column","together","with","its","corresponding","Field","object",".","Two","columns","with","the","same","Field","object","will","share","a","vocabulary",".","fields","(","dict","[","str",",","Field","]",")",":","Contains","the","name","of","each","column","or","field",",","together","with","the","corresponding","Field","object",".","Two","fields","with","the","same","Field","object","will","have","a","shared","vocabulary","."]
docstr: Download and unzip an online archive (.zip, .gz, or .tgz).
  
  Arguments:
      root (str): Folder to download data to.
      check (str or None): Folder whose existence indicates
          that the dataset has already been downloaded, or
          None to check the existence of root/{cls.name}.
  
  Returns:
      dataset_path (str): Path to extracted dataset.
docstr_tok: ["Download","and","unzip","an","online","archive","(",".zip",",",".gz",",","or",".tgz",")",".","Arguments",":","root","(","str",")",":","Folder","to","download","data","to",".","check","(","str","or","None",")",":","Folder","whose","existence","indicates","that","the","dataset","has","already","been","downloaded",",","or","None","to","check","the","existence","of","root\/","{","cls.name","}",".","Returns",":","dataset_path","(","str",")",":","Path","to","extracted","dataset","."]
code: def download(cls, root, check=None):
      """Download and unzip an online archive (.zip, .gz, or .tgz).
  
      Arguments:
          root (str): Folder to download data to.
          check (str or None): Folder whose existence indicates
              that the dataset has already been downloaded, or
              None to check the existence of root/{cls.name}.
  
      Returns:
          dataset_path (str): Path to extracted dataset.
      """
      path = os.path.join(root, cls.name)
      check = path if check is None else check
      if not os.path.isdir(check):
          for url in cls.urls:
              if isinstance(url, tuple):
                  url, filename = url
              else:
                  filename = os.path.basename(url)
              zpath = os.path.join(path, filename)
              if not os.path.isfile(zpath):
                  if not os.path.exists(os.path.dirname(zpath)):
                      os.makedirs(os.path.dirname(zpath))
                  print("downloading {}".format(filename))
                  download_from_url(url, zpath)
              ext = os.path.splitext(filename)[-1]
              if ext == ".zip":
                  with zipfile.ZipFile(zpath, "r") as zfile:
                      print("extracting")
                      zfile.extractall(path)
              elif ext in [".gz", ".tgz"]:
                  with tarfile.open(zpath, "r:gz") as tar:
                      dirs = [member for member in tar.getmembers()]
                      tar.extractall(path=path, members=dirs)
              elif ext in [".bz2", ".tar"]:
                  with tarfile.open(zpath) as tar:
                      dirs = [member for member in tar.getmembers()]
                      tar.extractall(path=path, members=dirs)
  
      return os.path.join(path, cls.dirname)
  
file_path: decanlp/text/torchtext/data/dataset.py
imports: import io
  import os
  import zipfile
  import tarfile
  import torch.utils.data
  from .example import Example
  from ..utils import download_from_url
label_desc: Use image node_id 7 for calling the Dataset obj's underlying member method code with example usage: obj.download(cls, root, check) and returns: os