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: Create a dataset from a list of Examples and Fields.
  
  Arguments:
      examples: List of Examples.
      fields (List(tuple(str, Field))): The Fields to use in this tuple. The
          string is a field name, and the Field is the associated field.
      filter_pred (callable or None): Use only examples for which
          filter_pred(example) is True, or use all examples if None.
          Default is None.
docstr_tok: ["Create","a","dataset","from","a","list","of","Examples","and","Fields",".","Arguments",":","examples",":","List","of","Examples",".","fields","(","List","(","tuple","(","str",",","Field",")",")",")",":","The","Fields","to","use","in","this","tuple",".","The","string","is","a","field","name",",","and","the","Field","is","the","associated","field",".","filter_pred","(","callable","or","None",")",":","Use","only","examples","for","which","filter_pred","(","example",")","is","True",",","or","use","all","examples","if","None",".","Default","is","None","."]
code: def __init__(self, examples, fields, filter_pred=None):
      """Create a dataset from a list of Examples and Fields.
  
      Arguments:
          examples: List of Examples.
          fields (List(tuple(str, Field))): The Fields to use in this tuple. The
              string is a field name, and the Field is the associated field.
          filter_pred (callable or None): Use only examples for which
              filter_pred(example) is True, or use all examples if None.
              Default is None.
      """
      if filter_pred is not None:
          make_list = isinstance(examples, list)
          examples = filter(filter_pred, examples)
          if make_list:
              examples = list(examples)
      self.examples = examples
      self.fields = dict(fields)
  
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 1 to create a new Dataset object from inherited base classes: torch.utils.data with example: obj = Dataset(examples, fields, filter_pred)