def sum_combiner(key, value, buf, done, params):
    """
    Sums the values for each key.

    This is a convenience function for performing a basic sum in the combiner.
    """
    if not done:
        buf[key] = buf.get(key, 0) + value
    else:
        return buf.iteritems()