<s> def prune_old_authorization_codes ( ) : <EOL> """<STR_LIT>""" <EOL> from . compat import now <EOL> from . models import AuthorizationCode <EOL> AuthorizationCode . objects . with_expiration_before ( now ( ) ) . delete ( ) <EOL> def get_handler ( handler_name ) : <EOL> """<STR_LIT>""" <EOL> from . conf import options <EOL> handlers = options . handlers <EOL> for handler in handlers : <EOL> handler_path = handler . split ( "<STR_LIT:.>" ) <EOL> name = handler_path [ - <NUM_LIT:2> ] <EOL> if handler_name == name : <EOL> handler_module = __import__ ( "<STR_LIT:.>" . join ( handler_path [ : - <NUM_LIT:1> ] ) , { } , { } , str ( handler_path [ - <NUM_LIT:1> ] ) ) <EOL> return getattr ( handler_module , handler_path [ - <NUM_LIT:1> ] ) ( ) <EOL> return None <EOL> def request_error_header ( exception ) : <EOL> """<STR_LIT>""" <EOL> from . conf import options <EOL> header = "<STR_LIT>" % ( options . realm , ) <EOL> if hasattr ( exception , "<STR_LIT:error>" ) : <EOL> header = header + "<STR_LIT>" % ( exception . error , ) <EOL> if hasattr ( exception , "<STR_LIT>" ) : <EOL> header = header + "<STR_LIT>" % ( exception . reason , ) <EOL> return header <EOL> def total_seconds ( delta ) : <EOL> """<STR_LIT>""" <EOL> return delta . days * <NUM_LIT> + delta . seconds </s>
