def attr(self, kw=None, _attributes=None, **attrs):
        """Add a general or graph/node/edge attribute statement.

        Args:
            kw: Attributes target (``None`` or ``'graph'``, ``'node'``, ``'edge'``).
            attrs: Attributes to be set (must be strings, may be empty).

        See the :ref:`usage examples in the User Guide <attributes>`.
        """
        if kw is not None and kw.lower() not in ('graph', 'node', 'edge'):
            raise ValueError('attr statement must target graph, node, or edge: '
                '%r' % kw)
        if attrs or _attributes:
            if kw is None:
                a_list = self._a_list(None, attrs, _attributes)
                line = self._attr_plain % a_list
            else:
                attr_list = self._attr_list(None, attrs, _attributes)
                line = self._attr % (kw, attr_list)
            self.body.append(line)
def attr ( self , kw = None , _attributes = None , ** attrs ) : if kw is not None and kw . lower ( ) not in ( 'graph' , 'node' , 'edge' ) : raise ValueError ( 'attr statement must target graph, node, or edge: ' '%r' % kw ) if attrs or _attributes : if kw is None : a_list = self . _a_list ( None , attrs , _attributes ) line = self . _attr_plain % a_list else : attr_list = self . _attr_list ( None , attrs , _attributes ) line = self . _attr % ( kw , attr_list ) self . body . append ( line )
Add a general or graph/node/edge attribute statement.

        Args:
            kw: Attributes target (``None`` or ``'graph'``, ``'node'``, ``'edge'``).
            attrs: Attributes to be set (must be strings, may be empty).

        See the :ref:`usage examples in the User Guide <attributes>`.