<s> __author__ = '<STR_LIT>' <EOL> import time <EOL> from cynic . handlers . base import BaseHTTPHandler <EOL> class HTTPSlowResponse ( BaseHTTPHandler ) : <EOL> """<STR_LIT>""" <EOL> CONTENT_TYPE = '<STR_LIT:application/json>' <EOL> TEMPLATE = '<STR_LIT>' <EOL> LOGGER_NAME = __name__ <EOL> def __init__ ( self , <EOL> connection , <EOL> client_address , <EOL> datapath = None , <EOL> content_type = '<STR_LIT:application/json>' , <EOL> sleep_interval = <NUM_LIT:30> , <EOL> ) : <EOL> BaseHTTPHandler . __init__ ( self , connection , client_address , datapath ) <EOL> self . CONTENT_TYPE = content_type <EOL> self . sleep_interval = sleep_interval <EOL> def do_GET ( self ) : <EOL> body = self . TEMPLATE <EOL> if self . data : <EOL> body = self . data <EOL> self . send_response ( <NUM_LIT:200> ) <EOL> self . send_header ( '<STR_LIT>' , len ( body ) ) <EOL> self . send_header ( '<STR_LIT:Content-Type>' , self . CONTENT_TYPE ) <EOL> self . end_headers ( ) <EOL> for ch in body : <EOL> self . wfile . write ( ch ) <EOL> self . wfile . flush ( ) <EOL> time . sleep ( self . sleep_interval ) </s>
