def add_or_increment(dictionary: dict, key: object, value: int=1):
    """
    Adds the `value` to the `key` if the `key` is in the `dictionary`. Otherwise, it creates the entry
    and initializes it with `value`. Useful for counting observed values.

    Parameters:
        dictionary (dict): Dictionary to update.
        key      (object): Key to update.
        value       (int): Value to increment.
    """
    if key in dictionary:
        dictionary[key] += value
    else:
        dictionary[key] = value
