def norm_attr_name(a):
    """``_foo_bar => _foo_bar``,  ``class_ => class``, ``max_height => max-height``

           >>> norm_attr_name(u'class_')
           u'class'
           >>> norm_attr_name(u'z_index')
           u'z-index'
    """
    if a[0] == u'_':
        return a
    if a[-1] == u'_':
        a = a[:-1]
    return a.replace(u'_', u'-')
