'Assign attrs to element.'

def assign_attrs(self, elem, attrs):

    for (k, v) in get_attrs(attrs):
        if (k == u'.'):
            cls = elem.get(u'class')
            if cls:
                elem.set(u'class', (u'%s    %s' % (cls, v)))
            else:
                elem.set(u'class', v)
        else:
            elem.set(self.sanitize_name(k), v)
