def Append(self, knot, span, intercept, gradient, layout):
    if self.entries:
      # Don't add a knot if the new segment is a linear extrapolation of
      # the last.
      k_last, s_last, i_last, g_last, _ = self.entries[-1]
      if (span == s_last and gradient == g_last and
          i_last + (knot - k_last) * g_last == intercept):
        return
    if knot < 0 or span < 0 or intercept < 0 or gradient < 0:
      raise AssertionError(('Internal error: bad layout'
                            '(k %d, s %d, i %f, g %f)') % (knot, span,
                                                           intercept, gradient))
    self.entries.append((knot, span, intercept, gradient, layout))
Add a segment to a Solution under construction.
dataset/ETHPy150Open google/rfmt/formatter/support.py/SolutionFactory.Append