def _merge_assocs_args_d_kwargs(args_dict, kwargs):
    """Merge args_dict and kwargs. Detect duplicate keys."""
    error_str = 'Association "%s" provided by argument and keyword argument'
    for key in args_dict:
        if key in kwargs:
            raise ValueError(error_str % key)
    merged = {}
    merged.update(args_dict)
    merged.update(kwargs)
    return merged
