class_docstr: Defines a single training or test example.
  
  Stores each column of the example as an attribute.
code: def fromdict(cls, data, fields):
      ex = cls()
      for key, vals in fields.items():
          if key not in data:
              raise ValueError(
                  "Specified key {} was not found in "
                  "the input data".format(key)
              )
          if vals is not None:
              if not isinstance(vals, list):
                  vals = [vals]
              for val in vals:
                  name, field = val
                  setattr(ex, name, field.preprocess(data[key]))
      return ex
  
file_path: pytext/pytext/legacy/data/example.py
imports: import json
  from functools import reduce
label_desc: Use image node_id 2 for calling the Example obj's underlying member method code with example usage: obj.fromdict(cls, data, fields) and returns: ex