#NEWLINE# def get_authn_statements( self , name_id , session_index = None , requested_context = None ) : #NEWLINE# #INDENT# '\n\n        :param name_id:\n        :param session_index:\n        :param requested_context:\n        :return:\n        ' #NEWLINE# result = [ ] #NEWLINE# key = sha1 ( code ( name_id ) ) . hexdigest ( ) #NEWLINE# try : #NEWLINE# #INDENT# statements = self . authn [ key ] #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# logger . info ( ( 'Unknown subject %s' % name_id ) ) #NEWLINE# return [ ] #NEWLINE# #UNINDENT# for statement in statements : #NEWLINE# #INDENT# if session_index : #NEWLINE# #INDENT# if ( statement . session_index != session_index ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# #UNINDENT# if requested_context : #NEWLINE# #INDENT# if ( not context_match ( requested_context , statement [ 0 ] . authn_context ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# #UNINDENT# result . append ( statement ) #NEWLINE# #UNINDENT# return result