MCPcopy Index your code
hub / github.com/lutzroeder/netron / _write

Method _write

source/server.py:112–122  ·  view source on GitHub ↗
(self, status_code, content_type, content)

Source from the content-addressed store, hash-verified

110 def log_message(self, format, *args):
111 logger.debug(" ".join(args))
112 def _write(self, status_code, content_type, content):
113 self.send_response(status_code)
114 if content:
115 self.send_header("Content-Type", content_type)
116 self.send_header("Content-Length", len(content))
117 self.end_headers()
118 if self.command != "HEAD":
119 if status_code == 404 and content is None:
120 self.wfile.write(str(status_code).encode("utf-8"))
121 elif (status_code in (200, 404)) and content is not None:
122 self.wfile.write(content)
123
124class _ThreadedHTTPServer(socketserver.ThreadingMixIn, http.server.HTTPServer):
125 pass

Callers 1

do_GETMethod · 0.95

Calls 2

encodeMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected