def stop_serve_forever(self):
assert hasattr(<EOL>self, "<STR_LIT>"<EOL>), "<STR_LIT>"<EOL>assert not self.stop_request, "<STR_LIT>"<EOL>self.stop_request = True<EOL>time.sleep(<NUM_LIT:0.1>)<EOL>if self.stopped:<EOL><INDENT>return<EOL><DEDENT>def _shutdownHandler(self):<EOL><INDENT>"""<STR_LIT>"""<EOL>self.send_response(<NUM_LIT:200>)<EOL>self.end_headers()<EOL>self.server.stop_request = True<EOL><DEDENT>if not hasattr(ExtHandler, "<STR_LIT>"):<EOL><INDENT>ExtHandler.do_SHUTDOWN = _shutdownHandler<EOL><DEDENT>(host, port) = self.server_address<EOL>conn = http_client.HTTPConnection("<STR_LIT>".format(host, port))<EOL>conn.request("<STR_LIT>", "<STR_LIT:/>")<EOL>conn.getresponse()<EOL>assert self.stop_request<EOL>
Stop serve_forever_stoppable().