code: def add(self, name, graph):
          
          if name in self:
              raise ValueError("{0} exists in this GraphCollection".format(name))
          elif hasattr(self, unicode(name)):
              raise ValueError("Name conflicts with an existing attribute")
  
          indexed_graph = self.index(name, graph)
  
          # Add all edges to the `master_graph`.
          for s, t, attrs in indexed_graph.edges(data=True):
              attrs.update({'graph': name})
              self.master_graph.add_edge(s, t, **attrs)
  
          # Add all node attributes to the `master_graph`.
          for n, attrs in indexed_graph.nodes(data=True):
              for k,v in attrs.iteritems():
                  if k not in self.master_graph.node[n]:
                      self.master_graph.node[n][k] = {}
                  self.master_graph.node[n][k][name] = v
  
          dict.__setitem__(self, name, indexed_graph)
docs: Index and add a :ref:`networkx.Graph <networkx:graph>` to the
          :class:`.GraphCollection`.
  
          Parameters
          ----------
          name : hashable
              Unique name used to identify the `graph`.
          graph : :ref:`networkx.Graph <networkx:graph>`
  
          Raises
          ------
          ValueError
              If `name` has already been used in this :class:`.GraphCollection`\.