def incrDictEntry(d, k, v):
    """
    If dictionary ``d`` has key ``k``, then increment ``d[k]`` by ``v``.
    Else set ``d[k] = v``.
    
    :param d: dictionary
    :param k: legal dictionary key (doesn't have to be in ``d``)
    :param v: numeric value
    """
    if k in d:
        d[k] += v
    else:
        d[k] = v
