prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  bug: webargs 5.0 introduces incompatibility with Flask < 1.0
  https://github.com/marshmallow-code/webargs/blob/5.0.0/webargs/flaskparser.py#L63
  
  `_get_data_for_json` is only available since Flask >= 1.0
  
  for Flask < 1.0, there is an error as follows:
  
  ```
    File "/usr/local/lib/python2.7/site-packages/webargs/flaskparser.py", line 63, in parse_json
      data = req._get_data_for_json(cache=True)
    File "/usr/local/lib/python2.7/site-packages/werkzeug/local.py", line 347, in __getattr__
      return getattr(self._get_current_object(), name)
  AttributeError: 'Request' object has no attribute '_get_data_for_json'
  ```
  
  I had to downgrade webargs to 4.4.1 to get it work.
  
  So you need to update this framework requirement https://github.com/marshmallow-code/webargs/blob/dev/setup.py#L11 or update the code for the backward compatibility.
  
  IMHO, using `_get_data_for_json` should be avoided because it's considered private and can be changed/removed anytime.
  
  </issue>
  <code>
  [start of webargs/flaskparser.py]
  1 # -*- coding: utf-8 -*-
  2 """Flask request argument parsing module.
  3 
  4 Example: ::
  5 
  6     from flask import Flask
  7 
  8     from webargs import fields
  9     from webargs.flaskparser import use_args
  10 
  11     app = Flask(__name__)
  12 
  13     hello_args = {
  14         'name': fields.Str(required=True)
  15     }
  16 
  17     @app.route('/')
  18     @use_args(hello_args)
  19     def index(args):
  20         return 'Hello ' + args['name']
  21 """
  22 import flask
  23 from werkzeug.exceptions import HTTPException
  24 
  25 from webargs import core
  26 from webargs.core import json
  27 
  28 
  29 def abort(http_status_code, exc=None, **kwargs):
  30     """Raise a HTTPException for the given http_status_code. Attach any keyword
  31     arguments to the exception for later processing.
  32 
  33     From Flask-Restful. See NOTICE file for license information.
  34     """
  35     try:
  36         flask.abort(http_status_code)
  37     except HTTPException as err:
  38         err.data = kwargs
  39         err.exc = exc
  40         raise err
  41 
  42 
  43 def is_json_request(req):
  44     return core.is_json(req.mimetype)
  45 
  46 
  47 class FlaskParser(core.Parser):
  48     """Flask request argument parser."""
  49 
  50     __location_map__ = dict(view_args="parse_view_args", **core.Parser.__location_map__)
  51 
  52     def parse_view_args(self, req, name, field):
  53         """Pull a value from the request's ``view_args``."""
  54         return core.get_value(req.view_args, name, field)
  55 
  56     def parse_json(self, req, name, field):
  57         """Pull a json value from the request."""
  58         json_data = self._cache.get("json")
  59         if json_data is None:
  60             # We decode the json manually here instead of
  61             # using req.get_json() so that we can handle
  62             # JSONDecodeErrors consistently
  63             data = req._get_data_for_json(cache=True)
  64             try:
  65                 self._cache["json"] = json_data = core.parse_json(data)
  66             except json.JSONDecodeError as e:
  67                 if e.doc == "":
  68                     return core.missing
  69                 else:
  70                     return self.handle_invalid_json_error(e, req)
  71         return core.get_value(json_data, name, field, allow_many_nested=True)
  72 
  73     def parse_querystring(self, req, name, field):
  74         """Pull a querystring value from the request."""
  75         return core.get_value(req.args, name, field)
  76 
  77     def parse_form(self, req, name, field):
  78         """Pull a form value from the request."""
  79         try:
  80             return core.get_value(req.form, name, field)
  81         except AttributeError:
  82             pass
  83         return core.missing
  84 
  85     def parse_headers(self, req, name, field):
  86         """Pull a value from the header data."""
  87         return core.get_value(req.headers, name, field)
  88 
  89     def parse_cookies(self, req, name, field):
  90         """Pull a value from the cookiejar."""
  91         return core.get_value(req.cookies, name, field)
  92 
  93     def parse_files(self, req, name, field):
  94         """Pull a file from the request."""
  95         return core.get_value(req.files, name, field)
  96 
  97     def handle_error(self, error, req, schema, error_status_code, error_headers):
  98         """Handles errors during parsing. Aborts the current HTTP request and
  99         responds with a 422 error.
  100         """
  101         status_code = error_status_code or self.DEFAULT_VALIDATION_STATUS
  102         abort(
  103             status_code,
  104             exc=error,
  105             messages=error.messages,
  106             schema=schema,
  107             headers=error_headers,
  108         )
  109 
  110     def handle_invalid_json_error(self, error, req, *args, **kwargs):
  111         abort(400, exc=error, messages={"json": ["Invalid JSON body."]})
  112 
  113     def get_default_request(self):
  114         """Override to use Flask's thread-local request objec by default"""
  115         return flask.request
  116 
  117 
  118 parser = FlaskParser()
  119 use_args = parser.use_args
  120 use_kwargs = parser.use_kwargs
  121
  [end of webargs/flaskparser.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/webargs/flaskparser.py b/webargs/flaskparser.py
  --- a/webargs/flaskparser.py
  +++ b/webargs/flaskparser.py
  @@ -60,7 +60,7 @@
               # We decode the json manually here instead of
               # using req.get_json() so that we can handle
               # JSONDecodeErrors consistently
  -            data = req._get_data_for_json(cache=True)
  +            data = req.get_data(cache=True)
               try:
                   self._cache["json"] = json_data = core.parse_json(data)
               except json.JSONDecodeError as e:
  
verification_info: {"golden_diff": "diff --git a/webargs/flaskparser.py b/webargs/flaskparser.py\n--- a/webargs/flaskparser.py\n+++ b/webargs/flaskparser.py\n@@ -60,7 +60,7 @@\n             # We decode the json manually here instead of\n             # using req.get_json() so that we can handle\n             # JSONDecodeErrors consistently\n-            data = req._get_data_for_json(cache=True)\n+            data = req.get_data(cache=True)\n             try:\n                 self._cache[\"json\"] = json_data = core.parse_json(data)\n             except json.JSONDecodeError as e:\n", "issue": "bug: webargs 5.0 introduces incompatibility with Flask < 1.0\nhttps://github.com/marshmallow-code/webargs/blob/5.0.0/webargs/flaskparser.py#L63\r\n\r\n`_get_data_for_json` is only available since Flask >= 1.0\r\n\r\nfor Flask < 1.0, there is an error as follows:\r\n\r\n```\r\n  File \"/usr/local/lib/python2.7/site-packages/webargs/flaskparser.py\", line 63, in parse_json\r\n    data = req._get_data_for_json(cache=True)\r\n  File \"/usr/local/lib/python2.7/site-packages/werkzeug/local.py\", line 347, in __getattr__\r\n    return getattr(self._get_current_object(), name)\r\nAttributeError: 'Request' object has no attribute '_get_data_for_json'\r\n```\r\n\r\nI had to downgrade webargs to 4.4.1 to get it work.\r\n\r\nSo you need to update this framework requirement https://github.com/marshmallow-code/webargs/blob/dev/setup.py#L11 or update the code for the backward compatibility.\r\n\r\nIMHO, using `_get_data_for_json` should be avoided because it's considered private and can be changed/removed anytime.\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n\"\"\"Flask request argument parsing module.\n\nExample: ::\n\n    from flask import Flask\n\n    from webargs import fields\n    from webargs.flaskparser import use_args\n\n    app = Flask(__name__)\n\n    hello_args = {\n        'name': fields.Str(required=True)\n    }\n\n    @app.route('/')\n    @use_args(hello_args)\n    def index(args):\n        return 'Hello ' + args['name']\n\"\"\"\nimport flask\nfrom werkzeug.exceptions import HTTPException\n\nfrom webargs import core\nfrom webargs.core import json\n\n\ndef abort(http_status_code, exc=None, **kwargs):\n    \"\"\"Raise a HTTPException for the given http_status_code. Attach any keyword\n    arguments to the exception for later processing.\n\n    From Flask-Restful. See NOTICE file for license information.\n    \"\"\"\n    try:\n        flask.abort(http_status_code)\n    except HTTPException as err:\n        err.data = kwargs\n        err.exc = exc\n        raise err\n\n\ndef is_json_request(req):\n    return core.is_json(req.mimetype)\n\n\nclass FlaskParser(core.Parser):\n    \"\"\"Flask request argument parser.\"\"\"\n\n    __location_map__ = dict(view_args=\"parse_view_args\", **core.Parser.__location_map__)\n\n    def parse_view_args(self, req, name, field):\n        \"\"\"Pull a value from the request's ``view_args``.\"\"\"\n        return core.get_value(req.view_args, name, field)\n\n    def parse_json(self, req, name, field):\n        \"\"\"Pull a json value from the request.\"\"\"\n        json_data = self._cache.get(\"json\")\n        if json_data is None:\n            # We decode the json manually here instead of\n            # using req.get_json() so that we can handle\n            # JSONDecodeErrors consistently\n            data = req._get_data_for_json(cache=True)\n            try:\n                self._cache[\"json\"] = json_data = core.parse_json(data)\n            except json.JSONDecodeError as e:\n                if e.doc == \"\":\n                    return core.missing\n                else:\n                    return self.handle_invalid_json_error(e, req)\n        return core.get_value(json_data, name, field, allow_many_nested=True)\n\n    def parse_querystring(self, req, name, field):\n        \"\"\"Pull a querystring value from the request.\"\"\"\n        return core.get_value(req.args, name, field)\n\n    def parse_form(self, req, name, field):\n        \"\"\"Pull a form value from the request.\"\"\"\n        try:\n            return core.get_value(req.form, name, field)\n        except AttributeError:\n            pass\n        return core.missing\n\n    def parse_headers(self, req, name, field):\n        \"\"\"Pull a value from the header data.\"\"\"\n        return core.get_value(req.headers, name, field)\n\n    def parse_cookies(self, req, name, field):\n        \"\"\"Pull a value from the cookiejar.\"\"\"\n        return core.get_value(req.cookies, name, field)\n\n    def parse_files(self, req, name, field):\n        \"\"\"Pull a file from the request.\"\"\"\n        return core.get_value(req.files, name, field)\n\n    def handle_error(self, error, req, schema, error_status_code, error_headers):\n        \"\"\"Handles errors during parsing. Aborts the current HTTP request and\n        responds with a 422 error.\n        \"\"\"\n        status_code = error_status_code or self.DEFAULT_VALIDATION_STATUS\n        abort(\n            status_code,\n            exc=error,\n            messages=error.messages,\n            schema=schema,\n            headers=error_headers,\n        )\n\n    def handle_invalid_json_error(self, error, req, *args, **kwargs):\n        abort(400, exc=error, messages={\"json\": [\"Invalid JSON body.\"]})\n\n    def get_default_request(self):\n        \"\"\"Override to use Flask's thread-local request objec by default\"\"\"\n        return flask.request\n\n\nparser = FlaskParser()\nuse_args = parser.use_args\nuse_kwargs = parser.use_kwargs\n", "path": "webargs/flaskparser.py"}]}