#NEWLINE# def _assemble_flows( self , flows ) : #NEWLINE# #INDENT# if isinstance ( flows , list ) : #NEWLINE# #INDENT# tmp = [ ] #NEWLINE# for f in flows : #NEWLINE# #INDENT# if isinstance ( f , datatypes . Flow ) : #NEWLINE# #INDENT# tmp . append ( f . to_dict ( ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise DatatypeError ( datatypes . Flow , f . __class__ ( ) ) #NEWLINE# #UNINDENT# #UNINDENT# data = { #NEWLINE# #INDENT# 'flows' : tmp , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( flows , datatypes . Flow ) : #NEWLINE# #INDENT# data = { #NEWLINE# #INDENT# 'flow' : flows . to_dict ( ) , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise DatatypeError ( [ datatypes . Flow , list ] , f . __class__ ( ) ) #NEWLINE# #UNINDENT# #UNINDENT# return data