code: def add_subgraph(self, sgraph):
          
  
          if not isinstance(sgraph, Subgraph) and not isinstance(sgraph, Cluster):
              raise TypeError('add_subgraph() received a non subgraph class object:' + str(sgraph))
              
          if self.obj_dict['subgraphs'].has_key(sgraph.get_name()):
          
              sgraph_list = self.obj_dict['subgraphs'][ sgraph.get_name() ]
              sgraph_list.append( sgraph.obj_dict )
                  
          else:
              self.obj_dict['subgraphs'][ sgraph.get_name() ] = [ sgraph.obj_dict ]
           
          sgraph.set_sequence( self.get_next_sequence_number() )
          
          sgraph.set_parent_graph( self.get_parent_graph() )
docs: Adds an subgraph object to the graph.
          
          It takes a subgraph object as its only argument and returns
          None.