code: def write_attributes(self, attrs):
          
          if attrs:
              self.write(
                  ' [' + ','.join('%s="%s"' % kv for kv in attrs.items()) + ']'
              )
          else:  # pragma: nocover
              pass
docs: Write comma separated attribute values (if exists).