Update a copy of dest with source.  If `keys` is a list, then only update
    with those keys.

def _updatecopy(orig, update_with, keys=None, override=False):
    """
    Update a copy of dest with source.  If `keys` is a list, then only update
    with those keys.
    """
    d = orig.copy()
    if keys is None:
        keys = update_with.keys()
    for k in keys:
        if k in update_with:
            if k in d and not override:
                continue
            d[k] = update_with[k]
    return d