#NEWLINE# def get_graph( self , title = None ) : #NEWLINE# #INDENT# ' Generate a DOT graph with pygraphviz, returns an AGraph object\n        Args:\n            title (string): Optional title for the graph.\n        ' #NEWLINE# if ( not pgv ) : #NEWLINE# #INDENT# raise Exception ( 'AGraph diagram requires pygraphviz' ) #NEWLINE# #UNINDENT# if ( title is None ) : #NEWLINE# #INDENT# title = self . __class__ . __name__ #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( title is False ) : #NEWLINE# #INDENT# title = '' #NEWLINE# #UNINDENT# #UNINDENT# fsm_graph = pgv . AGraph ( label = title , compound = True , ** self . machine_attributes ) #NEWLINE# fsm_graph . node_attr . update ( self . style_attributes [ 'node' ] [ 'default' ] ) #NEWLINE# self . _add_nodes ( self . machine . states , fsm_graph ) #NEWLINE# self . _add_edges ( fsm_graph . machine . events , fsm_graph ) #NEWLINE# setattr ( fsm_graph , 'style_attributes' , self . style_attributes ) #NEWLINE# return fsm_graph