<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def __attrs_str(self, tag, attrs):
 """ Build string of attributes list for tag """

        enabled = self.whitelist.get(tag, ['*'])
        all_attrs = '*' in enabled
        items = []
        for attr in attrs:
            key = attr[0]
            value = attr[1] or ''
            if all_attrs or key in enabled:
                items.append( u'%s="%s"' % (key, value,) )
        return u' '.join(items)