def merge_args_and_kwargs(param_names, args, kwargs):
    """Merges args and kwargs for a given list of parameter names into a single
    dictionary."""
    merged = dict(zip(param_names, args))
    merged.update(kwargs)
    return merged