#NEWLINE# def nodes( self , nodeType = None ) : #NEWLINE# #INDENT# '\n        Return a list of all nodes, nodes of a certain type, or nodes that have \n        names that match a regex pattern.\n        ' #NEWLINE# returnList = list ( ) #NEWLINE# for dagNode in self . network : #NEWLINE# #INDENT# if ( not nodeType ) : #NEWLINE# #INDENT# returnList . append ( dagNode ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( dagNode is nodeType ) : #NEWLINE# #INDENT# returnList . append ( dagNode ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return nodeType