def set_defaults(dic, **kwargs):
    """
    If keys are not already in the dic then add it with the val.
    This adds the keys to the existing dic, (does not copy!)

    Example:

    def something(**kwargs):
        # If kwargs doesn't already have "abc" and "def" then set them.
        kwargs = set_defaults(kwargs, abc=123, def=456)
        do_something(**kwargs)
    """
    for key, val in kwargs.items():
        if key not in dic:
            dic[key] = val
    return dic