#NEWLINE# def set_npn_protocols( self , protocols ) : #NEWLINE# #INDENT# self . protocols = list ( map ( ( lambda x : x . encode ( 'ascii' ) ) , protocols ) ) #NEWLINE# def cb( conn , protos ) : #NEWLINE# #INDENT# overlap = ( set ( protos ) & set ( self . protocols ) ) #NEWLINE# for p in self . protocols : #NEWLINE# #INDENT# if ( p in overlap ) : #NEWLINE# #INDENT# return p #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# return b'' #NEWLINE# #UNINDENT# #UNINDENT# self . _ctx . set_npn_select_callback ( cb )