Append (step, value) pair to history for the given mode and metric.

def append(self, mode, metric, step, value):
    """Append (step, value) pair to history for the given mode and metric."""
    if mode not in self._values:
      self._values[mode] = collections.defaultdict(list)
    self._values[mode][metric].append((step, value))