def _transform_kwargs(kwargs):
    """
    Replace underscores in the given dictionary's keys with dashes. Used to
    convert keyword argument names (which cannot contain dashes) to HTML
    attribute names, e.g. data-*.
    """
    
    return {key.replace('_', '-'): kwargs[key] for key in kwargs.keys()}