def METHOD_NAME(self, elem, attrs):
    """ Assign attrs to element. """
    for k, v in get_attrs(attrs):
        if k == '.':
            # add to class
            cls = elem.get('class')
            if cls:
                elem.set('class', '%s %s' % (cls, v))
            else:
                elem.set('class', v)
        else:
            # assign attr k with v
            elem.set(self.sanitize_name(k), v)