def stepping(start, stop, steps):
def clip(value):<EOL><INDENT>return max(value, stop) if (start > stop) else min(value, stop)<EOL><DEDENT>curr = float(start)<EOL>while True:<EOL><INDENT>yield clip(curr)<EOL>curr += (stop - start) / steps<EOL><DEDENT>
Yield an infinite series of values that step from a start value to a
    final value over some number of steps. Each step is (stop-start)/steps.

    After the final value is reached, the generator continues yielding that
    value.

    EXAMPLE:
      >>> sizes = stepping(1., 200., 100)
      >>> assert next(sizes) == 1.
      >>> assert next(sizes) == 1 * (200.-1.) / 100
      >>> assert next(sizes) == 1 + (200.-1.) / 100 + (200.-1.) / 100