def get_pairs(vals):
    """
    takes 1D list `vals` and returns 1D list of pairs.
    if input does not have an even number of elements,
    a 0 is padded at the end
    """
    if len(vals) % 2 == 1:
        vals = vals + [0.0]
    return zip(vals[::2], vals[1::2])
