#NEWLINE# def reverse( xc , p , contextItem , args ) : #NEWLINE# #INDENT# if ( len ( xc ) != 1 ) : #NEWLINE# #INDENT# raise XPathContext . FunctionNumArgs ( ) #NEWLINE# #UNINDENT# sequence = args [ 0 ] #NEWLINE# if ( len ( sequence ) == 0 ) : #NEWLINE# #INDENT# return [ ] #NEWLINE# #UNINDENT# return list ( reversed ( sequence ) )