Convert a reaction to reduced left, right dictionaries.

def _reaction_to_dicts(reaction):
    """Convert a reaction to reduced left, right dictionaries."""

    def dict_from_iter_sum(it):
        d = {}
        for k, v in it:
            if k not in d:
                d[k] = 0
            d[k] += v
        return d

    left = dict_from_iter_sum(reaction.left)
    right = dict_from_iter_sum(reaction.right)

    return left, right