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', '{} {}'.format(cls, v))
            else:
                elem.set('class', v)
        else:
            # assign attribute `k` with `v`
            elem.set(self.sanitize_name(k), v)