def METHOD_NAME(port=8000, cwd=None, terminate_callable=None):
    http = HTTPServer(('', port), HTTPRequestHandler)
    http.timeout = 1
    if cwd is None:
        cwd = os.getcwd()
    http.cwd = cwd
    while True:
        if terminate_callable is not None:
            terminate = terminate_callable()
        else:
            terminate = False
        if terminate:
            break
        http.handle_request()