def __init__(self, features):
    """Initialize `ExampleParser`.

      The `features` argument must be an object that can be converted to an
      `OrderedDict`. The keys should be strings and will be used to name the
      output. Values should be either `VarLenFeature` or `FixedLenFeature`. If
      `features` is a dict, it will be sorted by key.
    Args:
      features: An object that can be converted to an `OrderedDict` mapping
      column names to feature definitions.
    """
    super(ExampleParser, self).__init__()
    if isinstance(features, dict):
      self._ordered_features = collections.OrderedDict(sorted(features.items(
      ), key=lambda f: f[0]))
    else:
      self._ordered_features = collections.OrderedDict(features)