(self)
| 48 | |
| 49 | class MyServer(BaseHTTPRequestHandler): |
| 50 | def do_GET(self): |
| 51 | self.send_response(200) |
| 52 | self.send_header("Content-type", "application/json") |
| 53 | self.end_headers() |
| 54 | arg_dict = parse.urlparse(self.path) |
| 55 | if len(arg_dict.query) > 0 and 'q' in parse.parse_qs(arg_dict.query): |
| 56 | q = parse.parse_qs(arg_dict.query)['q'][0] |
| 57 | x_s = samples.generate_xs(q) |
| 58 | local_group_id = sess.run(tf.argmax(y, 1), feed_dict={x:x_s})[0] |
| 59 | group_id = samples.maps.real_group_id_map[str(local_group_id)] |
| 60 | print("q=", q, "group_id=", group_id) |
| 61 | self.wfile.write(bytes(str(group_id), "utf-8")) |
| 62 | |
| 63 | def main(is_predict): |
| 64 | if is_predict: |
nothing calls this directly
no test coverage detected