#NEWLINE# @ classmethod #NEWLINE# def parse( cls , transport ) : #NEWLINE# #INDENT# if isinstance ( transport , cls ) : #NEWLINE# #INDENT# return transport #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( type ( transport ) == str ) : #NEWLINE# #INDENT# if ( '|' in transport ) : #NEWLINE# #INDENT# ( inner , outer ) = transport . rsplit ( '|' , 1 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ( inner , outer ) = ( '' , transport ) #NEWLINE# #UNINDENT# return cls ( inner , outer ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise ValueError ( ( 'could not parse transport: %s' % transport ) )