graphit/graph.py
def add_nodes(self, nodes, unicode_convert=True, run_node_new=True, **kwargs):
        """
        Add multiple nodes to the graph.
        
        This is the iterable version of the add_node methods allowing
        multiple node additions from any iterable.
        If the iterable yields a tuple with a dictionary as seconds
        argument the key/value pairs of that dictionary will be added
        as attributes to the new node along with any keyword arguments
        passed to the method.

        The latter functionality can be used to add the nodes of one
        graph to those of another by using graph.nodes.items() as
        argument to `add_nodes`.
        
        :param nodes:           Objects to be added as nodes to the graph
        :type nodes:            Iterable of hashable objects
        :param unicode_convert: convert string types to unicode
        :type unicode_convert:  :py:bool
        :param run_node_new:    run the custom initiation method (new method) of
                                the new nodes once.
        :type run_node_new:     :py:bool

        :return:                list of node ids for the objects added in the
                                same order as th input iterable.
        :rtype:                 :py:list
        """
        
        node_collection = []
        for node in nodes:

            # Check if node has argument dictionary
            if isinstance(node, (tuple, list)):
                if len(node) == 2 and isinstance(node[1], dict):
                    attr = {}
                    attr.update(node[1])
                    attr.update(kwargs)
                    node_collection.append(self.add_node(node[0], unicode_convert=unicode_convert,
                                                         run_node_new=run_node_new, **attr))
            else:
                node_collection.append(self.add_node(node, unicode_convert=unicode_convert,
                                                     run_node_new=run_node_new, **kwargs))
        
        return node_collection

        Add multiple nodes to the graph.
        
        This is the iterable version of the add_node methods allowing
        multiple node additions from any iterable.
        If the iterable yields a tuple with a dictionary as seconds
        argument the key/value pairs of that dictionary will be added
        as attributes to the new node along with any keyword arguments
        passed to the method.

        The latter functionality can be used to add the nodes of one
        graph to those of another by using graph.nodes.items() as
        argument to `add_nodes`.
        
        :param nodes:           Objects to be added as nodes to the graph
        :type nodes:            Iterable of hashable objects
        :param unicode_convert: convert string types to unicode
        :type unicode_convert:  :py:bool
        :param run_node_new:    run the custom initiation method (new method) of
                                the new nodes once.
        :type run_node_new:     :py:bool

        :return:                list of node ids for the objects added in the
                                same order as th input iterable.
        :rtype:                 :py:list
        
Add multiple nodes to the graph.
This is the iterable version of the add_node methods allowing
multiple node additions from any iterable.
If the iterable yields a tuple with a dictionary as seconds
argument the key/value pairs of that dictionary will be added
as attributes to the new node along with any keyword arguments
passed to the method.

The latter functionality can be used to add the nodes of one
graph to those of another by using graph.nodes.items() as
argument to `add_nodes`.
Add multiple nodes to the graph . This is the iterable version of the add_node methods allowing multiple node additions from any iterable . If the iterable yields a tuple with a dictionary as seconds argument the key / value pairs of that dictionary will be added as attributes to the new node along with any keyword arguments passed to the method . The latter functionality can be used to add the nodes of one graph to those of another by using graph . nodes . items () as argument to ` add_nodes ` .
def add_nodes(self, nodes, unicode_convert=True, run_node_new=True, **kwargs):
        node_collection = []
        for node in nodes:
            if isinstance(node, (tuple, list)):
                if len(node) == 2 and isinstance(node[1], dict):
                    attr = {}
                    attr.update(node[1])
                    attr.update(kwargs)
                    node_collection.append(self.add_node(node[0], unicode_convert=unicode_convert,
                                                         run_node_new=run_node_new, **attr))
            else:
                node_collection.append(self.add_node(node, unicode_convert=unicode_convert,
                                                     run_node_new=run_node_new, **kwargs))
        return node_collection
def add_nodes ( self , nodes , unicode_convert = True , run_node_new = True , ** kwargs ) : node_collection = [ ] for node in nodes : if isinstance ( node , ( tuple , list ) ) : if len ( node ) == 2 and isinstance ( node [ 1 ] , dict ) : attr = { } attr . update ( node [ 1 ] ) attr . update ( kwargs ) node_collection . append ( self . add_node ( node [ 0 ] , unicode_convert = unicode_convert , run_node_new = run_node_new , ** attr ) ) else : node_collection . append ( self . add_node ( node , unicode_convert = unicode_convert , run_node_new = run_node_new , ** kwargs ) ) return node_collection
Add multiple nodes to the graph.
Add multiple nodes to the graph .
"""
        Add multiple nodes to the graph.
        
        This is the iterable version of the add_node methods allowing
        multiple node additions from any iterable.
        If the iterable yields a tuple with a dictionary as seconds
        argument the key/value pairs of that dictionary will be added
        as attributes to the new node along with any keyword arguments
        passed to the method.

        The latter functionality can be used to add the nodes of one
        graph to those of another by using graph.nodes.items() as
        argument to `add_nodes`.
        
        :param nodes:           Objects to be added as nodes to the graph
        :type nodes:            Iterable of hashable objects
        :param unicode_convert: convert string types to unicode
        :type unicode_convert:  :py:bool
        :param run_node_new:    run the custom initiation method (new method) of
                                the new nodes once.
        :type run_node_new:     :py:bool

        :return:                list of node ids for the objects added in the
                                same order as th input iterable.
        :rtype:                 :py:list
        """ # Check if node has argument dictionary
list of node ids for the objects added in the
same order as th input iterable.
list of node ids for the objects added in the same order as th input iterable .
:py:list
self
nodes
Objects to be added as nodes to the graph
Objects to be added as nodes to the graph
unicode_convert
convert string types to unicode
convert string types to unicode
run_node_new
run the custom initiation method (new method) of
the new nodes once.
run the custom initiation method ( new method ) of the new nodes once .