MCPcopy Index your code
hub / github.com/tinygrad/tinygrad / send_data

Method send_data

tinygrad/viz/serve.py:23–28  ·  view source on GitHub ↗
(self, data:bytes, content_type:str="application/json", status_code:int=200)

Source from the content-addressed store, hash-verified

21
22class HTTPRequestHandler(BaseHTTPRequestHandler):
23 def send_data(self, data:bytes, content_type:str="application/json", status_code:int=200):
24 self.send_response(status_code)
25 self.send_header("Content-Type", content_type)
26 self.send_header("Content-Length", str(len(data)))
27 self.end_headers()
28 return self.wfile.write(data)
29 def stream_json(self, source:Generator):
30 try:
31 self.send_response(200)

Callers 3

do_GETMethod · 0.80
do_POSTMethod · 0.80
do_GETMethod · 0.80

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected