#NEWLINE# def get_delays( stanza ) : #NEWLINE# #INDENT# 'Get jabber:x:delay elements from the stanza.\n\n    :Parameters:\n        - `stanza`: a, probably delayed, stanza.\n    :Types:\n        - `stanza`: `pyxmpp.stanza.Stanza`\n\n    :return: list of delay tags sorted by the timestamp.\n    :returntype: `list` of `Delay`' #NEWLINE# delays = [ ] #NEWLINE# n = stanza . xmlnode . children #NEWLINE# while n : #NEWLINE# #INDENT# if ( ( n . type == 'element' ) and ( get_node_ns_uri ( n ) == DELAY_NS ) and ( n . name == 'x' ) ) : #NEWLINE# #INDENT# delays . append ( Delay ( n ) ) #NEWLINE# #UNINDENT# n = n . __next__ #NEWLINE# #UNINDENT# delays . sort ( ) #NEWLINE# return delays