#NEWLINE# def set_cookie_if_ok( self , cookie , request ) : #NEWLINE# #INDENT# "Set a cookie if policy says it's OK to do so." #NEWLINE# self . _cookies_lock . acquire ( ) #NEWLINE# self . _policy . _now = self . _now = int ( time . time ( ) ) #NEWLINE# if self . _policy . set_ok ( cookie , request ) : #NEWLINE# #INDENT# self . set_cookie ( cookie ) #NEWLINE# #UNINDENT# self . _cookies_lock . release ( )