def update_dict_in_dict(dictionary, key, **kwargs):
    """ Add a key-value argument to a dict inside a dict, automatically creates dict. """
    assert isinstance(dictionary, dict)
    if key in dictionary:
        assert isinstance(dictionary[key], dict)
    else:
        dictionary[key] = {}

    dictionary[key].update(kwargs)
    return dictionary