#NEWLINE# def _move_session_handler( handlers ) : #NEWLINE# #INDENT# 'Find a SessionHandler instance in the list and move it to the beginning.\n    ' #NEWLINE# index = 0 #NEWLINE# for ( i , handler ) in enumerate ( handlers ) : #NEWLINE# #INDENT# if isinstance ( handler , SessionHandler ) : #NEWLINE# #INDENT# index = i #NEWLINE# break #NEWLINE# #UNINDENT# #UNINDENT# if index : #NEWLINE# #INDENT# handlers [ : ( index + 1 ) ] = ( [ index [ index ] ] + handlers [ : index ] )