prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  unable to use vyper-serve 0.3.6
  ### Version Information
  
  * vyper Version (output of `vyper --version`): 0.3.6
  * OS: ubutu
  * Python Version 3.8
  
  ### What's your issue about?
  
  unable to use the vyper-serve api endpoint, the call always fail with an error:
  `Unable to json serialize IRNode`
  
  </issue>
  <code>
  [start of vyper/cli/vyper_serve.py]
  1 #!/usr/bin/env python3
  2 
  3 import argparse
  4 import json
  5 import sys
  6 from http.server import BaseHTTPRequestHandler, HTTPServer
  7 from socketserver import ThreadingMixIn
  8 
  9 import vyper
  10 from vyper.codegen import ir_node
  11 from vyper.evm.opcodes import DEFAULT_EVM_VERSION
  12 from vyper.exceptions import VyperException
  13 
  14 
  15 def _parse_cli_args():
  16     return _parse_args(sys.argv[1:])
  17 
  18 
  19 def _parse_args(argv):
  20     parser = argparse.ArgumentParser(description="Serve Vyper compiler as an HTTP Service")
  21     parser.add_argument(
  22         "--version", action="version", version=f"{vyper.__version__}+commit{vyper.__commit__}"
  23     )
  24     parser.add_argument(
  25         "-b",
  26         help="Address to bind JSON server on, default: localhost:8000",
  27         default="localhost:8000",
  28         dest="bind_address",
  29     )
  30 
  31     args = parser.parse_args(argv)
  32 
  33     if ":" in args.bind_address:
  34         ir_node.VYPER_COLOR_OUTPUT = False
  35         runserver(*args.bind_address.split(":"))
  36     else:
  37         print('Provide bind address in "{address}:{port}" format')
  38 
  39 
  40 class VyperRequestHandler(BaseHTTPRequestHandler):
  41     def send_404(self):
  42         self.send_response(404)
  43         self.end_headers()
  44         return
  45 
  46     def send_cors_all(self):
  47         self.send_header("Access-Control-Allow-Origin", "*")
  48         self.send_header("Access-Control-Allow-Headers", "X-Requested-With, Content-type")
  49 
  50     def do_OPTIONS(self):
  51         self.send_response(200)
  52         self.send_cors_all()
  53         self.end_headers()
  54 
  55     def do_GET(self):
  56         if self.path == "/":
  57             self.send_response(200)
  58             self.send_cors_all()
  59             self.end_headers()
  60             self.wfile.write(f"Vyper Compiler. Version: {vyper.__version__}\n".encode())
  61         else:
  62             self.send_404()
  63 
  64         return
  65 
  66     def do_POST(self):
  67         if self.path == "/compile":
  68             content_len = int(self.headers.get("content-length"))
  69             post_body = self.rfile.read(content_len)
  70             data = json.loads(post_body)
  71 
  72             response, status_code = self._compile(data)
  73 
  74             self.send_response(status_code)
  75             self.send_header("Content-type", "application/json")
  76             self.send_cors_all()
  77             self.end_headers()
  78             self.wfile.write(json.dumps(response).encode())
  79 
  80         else:
  81             self.send_404()
  82 
  83         return
  84 
  85     def _compile(self, data):
  86         code = data.get("code")
  87         if not code:
  88             return {"status": "failed", "message": 'No "code" key supplied'}, 400
  89         if not isinstance(code, str):
  90             return {"status": "failed", "message": '"code" must be a non-empty string'}, 400
  91 
  92         try:
  93             code = data["code"]
  94             out_dict = vyper.compile_codes(
  95                 {"": code},
  96                 list(vyper.compiler.OUTPUT_FORMATS.keys()),
  97                 evm_version=data.get("evm_version", DEFAULT_EVM_VERSION),
  98             )[""]
  99             out_dict["ir"] = str(out_dict["ir"])
  100         except VyperException as e:
  101             return (
  102                 {"status": "failed", "message": str(e), "column": e.col_offset, "line": e.lineno},
  103                 400,
  104             )
  105         except SyntaxError as e:
  106             return (
  107                 {"status": "failed", "message": str(e), "column": e.offset, "line": e.lineno},
  108                 400,
  109             )
  110 
  111         out_dict.update({"status": "success"})
  112 
  113         return out_dict, 200
  114 
  115 
  116 class VyperHTTPServer(ThreadingMixIn, HTTPServer):
  117     """Handle requests in a separate thread."""
  118 
  119     pass
  120 
  121 
  122 def runserver(host="", port=8000):
  123     server_address = (host, int(port))
  124     httpd = VyperHTTPServer(server_address, VyperRequestHandler)
  125     print(f"Listening on http://{host}:{port}")
  126     httpd.serve_forever()
  127
  [end of vyper/cli/vyper_serve.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/vyper/cli/vyper_serve.py b/vyper/cli/vyper_serve.py
  --- a/vyper/cli/vyper_serve.py
  +++ b/vyper/cli/vyper_serve.py
  @@ -97,6 +97,7 @@
                   evm_version=data.get("evm_version", DEFAULT_EVM_VERSION),
               )[""]
               out_dict["ir"] = str(out_dict["ir"])
  +            out_dict["ir_runtime"] = str(out_dict["ir_runtime"])
           except VyperException as e:
               return (
                   {"status": "failed", "message": str(e), "column": e.col_offset, "line": e.lineno},
  
verification_info: {"golden_diff": "diff --git a/vyper/cli/vyper_serve.py b/vyper/cli/vyper_serve.py\n--- a/vyper/cli/vyper_serve.py\n+++ b/vyper/cli/vyper_serve.py\n@@ -97,6 +97,7 @@\n                 evm_version=data.get(\"evm_version\", DEFAULT_EVM_VERSION),\n             )[\"\"]\n             out_dict[\"ir\"] = str(out_dict[\"ir\"])\n+            out_dict[\"ir_runtime\"] = str(out_dict[\"ir_runtime\"])\n         except VyperException as e:\n             return (\n                 {\"status\": \"failed\", \"message\": str(e), \"column\": e.col_offset, \"line\": e.lineno},\n", "issue": "unable to use vyper-serve 0.3.6\n### Version Information\r\n\r\n* vyper Version (output of `vyper --version`): 0.3.6\r\n* OS: ubutu\r\n* Python Version 3.8\r\n\r\n### What's your issue about?\r\n\r\nunable to use the vyper-serve api endpoint, the call always fail with an error:\r\n`Unable to json serialize IRNode`\n", "before_files": [{"content": "#!/usr/bin/env python3\n\nimport argparse\nimport json\nimport sys\nfrom http.server import BaseHTTPRequestHandler, HTTPServer\nfrom socketserver import ThreadingMixIn\n\nimport vyper\nfrom vyper.codegen import ir_node\nfrom vyper.evm.opcodes import DEFAULT_EVM_VERSION\nfrom vyper.exceptions import VyperException\n\n\ndef _parse_cli_args():\n    return _parse_args(sys.argv[1:])\n\n\ndef _parse_args(argv):\n    parser = argparse.ArgumentParser(description=\"Serve Vyper compiler as an HTTP Service\")\n    parser.add_argument(\n        \"--version\", action=\"version\", version=f\"{vyper.__version__}+commit{vyper.__commit__}\"\n    )\n    parser.add_argument(\n        \"-b\",\n        help=\"Address to bind JSON server on, default: localhost:8000\",\n        default=\"localhost:8000\",\n        dest=\"bind_address\",\n    )\n\n    args = parser.parse_args(argv)\n\n    if \":\" in args.bind_address:\n        ir_node.VYPER_COLOR_OUTPUT = False\n        runserver(*args.bind_address.split(\":\"))\n    else:\n        print('Provide bind address in \"{address}:{port}\" format')\n\n\nclass VyperRequestHandler(BaseHTTPRequestHandler):\n    def send_404(self):\n        self.send_response(404)\n        self.end_headers()\n        return\n\n    def send_cors_all(self):\n        self.send_header(\"Access-Control-Allow-Origin\", \"*\")\n        self.send_header(\"Access-Control-Allow-Headers\", \"X-Requested-With, Content-type\")\n\n    def do_OPTIONS(self):\n        self.send_response(200)\n        self.send_cors_all()\n        self.end_headers()\n\n    def do_GET(self):\n        if self.path == \"/\":\n            self.send_response(200)\n            self.send_cors_all()\n            self.end_headers()\n            self.wfile.write(f\"Vyper Compiler. Version: {vyper.__version__}\\n\".encode())\n        else:\n            self.send_404()\n\n        return\n\n    def do_POST(self):\n        if self.path == \"/compile\":\n            content_len = int(self.headers.get(\"content-length\"))\n            post_body = self.rfile.read(content_len)\n            data = json.loads(post_body)\n\n            response, status_code = self._compile(data)\n\n            self.send_response(status_code)\n            self.send_header(\"Content-type\", \"application/json\")\n            self.send_cors_all()\n            self.end_headers()\n            self.wfile.write(json.dumps(response).encode())\n\n        else:\n            self.send_404()\n\n        return\n\n    def _compile(self, data):\n        code = data.get(\"code\")\n        if not code:\n            return {\"status\": \"failed\", \"message\": 'No \"code\" key supplied'}, 400\n        if not isinstance(code, str):\n            return {\"status\": \"failed\", \"message\": '\"code\" must be a non-empty string'}, 400\n\n        try:\n            code = data[\"code\"]\n            out_dict = vyper.compile_codes(\n                {\"\": code},\n                list(vyper.compiler.OUTPUT_FORMATS.keys()),\n                evm_version=data.get(\"evm_version\", DEFAULT_EVM_VERSION),\n            )[\"\"]\n            out_dict[\"ir\"] = str(out_dict[\"ir\"])\n        except VyperException as e:\n            return (\n                {\"status\": \"failed\", \"message\": str(e), \"column\": e.col_offset, \"line\": e.lineno},\n                400,\n            )\n        except SyntaxError as e:\n            return (\n                {\"status\": \"failed\", \"message\": str(e), \"column\": e.offset, \"line\": e.lineno},\n                400,\n            )\n\n        out_dict.update({\"status\": \"success\"})\n\n        return out_dict, 200\n\n\nclass VyperHTTPServer(ThreadingMixIn, HTTPServer):\n    \"\"\"Handle requests in a separate thread.\"\"\"\n\n    pass\n\n\ndef runserver(host=\"\", port=8000):\n    server_address = (host, int(port))\n    httpd = VyperHTTPServer(server_address, VyperRequestHandler)\n    print(f\"Listening on http://{host}:{port}\")\n    httpd.serve_forever()\n", "path": "vyper/cli/vyper_serve.py"}]}