def sum_reduce(iter, params):
    """
    Sums the values for each key.

    This is a convenience function for performing a basic sum in the reduce.
    """
    buf = {}
    for key, value in iter:
        buf[key] = buf.get(key, 0) + value
    return buf.items()