def combine_counts(counts1, counts2):
    """
    Combine two counts dictionaries.
    """
    ret = counts1
    for key, val in counts2.items():
        if key in ret:
            ret[key] += val
        else:
            ret[key] = val
    return ret