def merge_value_dicts(old_value_dict, new_value_dict, zero_missing=False):
    """
    Merge an old and new value dict together, returning the merged value dict.

    Value dicts map from label values tuple -> metric value.

    Values from the new value dict have precidence. If any label values tuples
    from the old value dict are not present in the new value dict and
    zero_missing is set, their values are reset to zero.
    """
    value_dict = new_value_dict.copy()
    value_dict.update({
        label_values: 0 if zero_missing else old_value
        for label_values, old_value
        in old_value_dict.items()
        if label_values not in new_value_dict
    })
    return value_dict