(self, other)
return g
Copies the graph and extends the copy depending on the type of
        the other object given.

        @param other: if it is an integer, the copy is extended by the given
          number of vertices. If it is a string, the copy is extended by a
          single vertex whose C{name} attribute will be equal to the given
          string. If it is a tuple with two elements, the copy
          is extended by a single edge. If it is a list of tuples, the copy
          is extended by multiple edges. If it is a L{Graph}, a disjoint
          union is performed.
Copies the graph and extends the copy depending on the type of
        the other object given.
Copies the graph and extends the copy depending on the type of the other object given .
def __add__(self, other):
        """Copies the graph and extends the copy depending on the type of
        the other object given.

        @param other: if it is an integer, the copy is extended by the given
          number of vertices. If it is a string, the copy is extended by a
          single vertex whose C{name} attribute will be equal to the given
          string. If it is a tuple with two elements, the copy
          is extended by a single edge. If it is a list of tuples, the copy
          is extended by multiple edges. If it is a L{Graph}, a disjoint
          union is performed.
        """
        if isinstance(other, (int, str)):
            g = self.copy()
            g.add_vertices(other)
        elif isinstance(other, tuple) and len(other) == 2:
            g = self.copy()
            g.add_edges([other])
        elif isinstance(other, list):
            if len(other) > 0:
                if isinstance(other[0], tuple):
                    g = self.copy()
                    g.add_edges(other)
                elif isinstance(other[0], str):
                    g = self.copy()
                    g.add_vertices(other)
                elif isinstance(other[0], Graph):
                    return self.disjoint_union(other)
                else:
                    return NotImplemented
            else:
                return self.copy()

        elif isinstance(other, Graph):
            return self.disjoint_union(other)
        else:
            return NotImplemented

        return g
def __add__ ( self , other ) : if isinstance ( other , ( int , str ) ) : g = self . copy ( ) g . add_vertices ( other ) elif isinstance ( other , tuple ) and len ( other ) == 2 : g = self . copy ( ) g . add_edges ( [ other ] ) elif isinstance ( other , list ) : if len ( other ) > 0 : if isinstance ( other [ 0 ] , tuple ) : g = self . copy ( ) g . add_edges ( other ) elif isinstance ( other [ 0 ] , str ) : g = self . copy ( ) g . add_vertices ( other ) elif isinstance ( other [ 0 ] , Graph ) : return self . disjoint_union ( other ) else : return NotImplemented else : return self . copy ( ) elif isinstance ( other , Graph ) : return self . disjoint_union ( other ) else : return NotImplemented return g