prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  explanations no longer working with 0.3.0
  Am following the steps in with 0.3.0 of kfserving: https://github.com/kubeflow/kfserving/tree/master/docs/samples/explanation/alibi/income
  
  When I execute the curl for the explain I get a 500 error and the container logs show the below. I'm guessing the [update to master](https://github.com/kubeflow/kfserving/pull/803) means that the explainer models have also been updated and so they no longer work with 0.3.0 (the latest release version)
  
  ```
  [E 200605 17:15:14 web:1792] Uncaught exception POST /v1/models/income:explain (127.0.0.1)
      HTTPServerRequest(protocol='http', host='income-explainer-default.default.svc.cluster.local', method='POST', uri='/v1/models/income:explain', version='HTTP/1.1', remote_ip='127.0.0.1')
      Traceback (most recent call last):
        File "/usr/local/lib/python3.7/site-packages/tornado/web.py", line 1701, in _execute
          result = method(*self.path_args, **self.path_kwargs)
        File "/kfserving/kfserving/handlers/http.py", line 61, in post
          response = model.explain(request)
        File "/alibiexplainer/alibiexplainer/explainer.py", line 74, in explain
          explanation = self.wrapper.explain(request["instances"])
        File "/alibiexplainer/alibiexplainer/anchor_tabular.py", line 89, in explain
          anchor_exp = self.anchors_tabular.explain(arr[0], **self.kwargs)
        File "/usr/local/lib/python3.7/site-packages/alibi/explainers/anchor_tabular.py", line 803, in explain
          for sampler in self.samplers:
      AttributeError: 'AnchorTabular' object has no attribute 'samplers'
  [E 200605 17:15:14 web:2250] 500 POST /v1/models/income:explain (127.0.0.1) 58.80ms
  [I 200605 17:18:22 anchor_tabular:83] Arr shape ((1, 12),) 
  [E 200605 17:18:22 web:1792] Uncaught exception POST /v1/models/income:explain (127.0.0.1)
      HTTPServerRequest(protocol='http', host='income-explainer-default.default.svc.cluster.local', method='POST', uri='/v1/models/income:explain', version='HTTP/1.1', remote_ip='127.0.0.1')
      Traceback (most recent call last):
        File "/usr/local/lib/python3.7/site-packages/tornado/web.py", line 1701, in _execute
          result = method(*self.path_args, **self.path_kwargs)
        File "/kfserving/kfserving/handlers/http.py", line 61, in post
          response = model.explain(request)
        File "/alibiexplainer/alibiexplainer/explainer.py", line 74, in explain
          explanation = self.wrapper.explain(request["instances"])
        File "/alibiexplainer/alibiexplainer/anchor_tabular.py", line 89, in explain
          anchor_exp = self.anchors_tabular.explain(arr[0], **self.kwargs)
        File "/usr/local/lib/python3.7/site-packages/alibi/explainers/anchor_tabular.py", line 803, in explain
          for sampler in self.samplers:
      AttributeError: 'AnchorTabular' object has no attribute 'samplers'
  [E 200605 17:18:22 web:2250] 500 POST /v1/models/income:explain (127.0.0.1) 31.17ms
  
  ```
  
  Presumably it would work on master. Does that sound right @cliveseldon ? If so maybe we should just close this.
  
  </issue>
  <code>
  [start of python/alibiexplainer/setup.py]
  1 # Copyright 2019 kubeflow.org.
  2 #
  3 # Licensed under the Apache License, Version 2.0 (the "License");
  4 # you may not use this file except in compliance with the License.
  5 # You may obtain a copy of the License at
  6 #
  7 #    http://www.apache.org/licenses/LICENSE-2.0
  8 #
  9 # Unless required by applicable law or agreed to in writing, software
  10 # distributed under the License is distributed on an "AS IS" BASIS,
  11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12 # See the License for the specific language governing permissions and
  13 # limitations under the License.
  14 
  15 from setuptools import setup, find_packages
  16 
  17 tests_require = [
  18     'pytest',
  19     'pytest-tornasync',
  20     'mypy'
  21 ]
  22 
  23 setup(
  24     name='alibiexplainer',
  25     version='0.3.0',
  26     author_email='cc@seldon.io',
  27     license='../../LICENSE.txt',
  28     url='https://github.com/kubeflow/kfserving/python/kfserving/alibiexplainer',
  29     description='Model Explaination Server. \
  30                  Not intended for use outside KFServing Frameworks Images',
  31     long_description=open('README.md').read(),
  32     python_requires='>=3.6',
  33     packages=find_packages("alibiexplainer"),
  34     install_requires=[
  35         "kfserving>=0.3.0",
  36         "alibi>=0.3",
  37         "scikit-learn>=0.20.3",
  38         "argparse>=1.4.0",
  39         "requests>=2.22.0",
  40         "joblib>=0.13.2",
  41         "pandas>=0.24.2",
  42         "numpy>=1.16.3",
  43         "dill>=0.3.0",
  44         "spacy>=2.1.4"
  45     ],
  46     tests_require=tests_require,
  47     extras_require={'test': tests_require}
  48 )
  49
  [end of python/alibiexplainer/setup.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/python/alibiexplainer/setup.py b/python/alibiexplainer/setup.py
  --- a/python/alibiexplainer/setup.py
  +++ b/python/alibiexplainer/setup.py
  @@ -33,7 +33,7 @@
       packages=find_packages("alibiexplainer"),
       install_requires=[
           "kfserving>=0.3.0",
  -        "alibi>=0.3",
  +        "alibi==0.3.2",
           "scikit-learn>=0.20.3",
           "argparse>=1.4.0",
           "requests>=2.22.0",
  
verification_info: {"golden_diff": "diff --git a/python/alibiexplainer/setup.py b/python/alibiexplainer/setup.py\n--- a/python/alibiexplainer/setup.py\n+++ b/python/alibiexplainer/setup.py\n@@ -33,7 +33,7 @@\n     packages=find_packages(\"alibiexplainer\"),\n     install_requires=[\n         \"kfserving>=0.3.0\",\n-        \"alibi>=0.3\",\n+        \"alibi==0.3.2\",\n         \"scikit-learn>=0.20.3\",\n         \"argparse>=1.4.0\",\n         \"requests>=2.22.0\",\n", "issue": "explanations no longer working with 0.3.0\nAm following the steps in with 0.3.0 of kfserving: https://github.com/kubeflow/kfserving/tree/master/docs/samples/explanation/alibi/income\r\n\r\nWhen I execute the curl for the explain I get a 500 error and the container logs show the below. I'm guessing the [update to master](https://github.com/kubeflow/kfserving/pull/803) means that the explainer models have also been updated and so they no longer work with 0.3.0 (the latest release version)\r\n\r\n```\r\n[E 200605 17:15:14 web:1792] Uncaught exception POST /v1/models/income:explain (127.0.0.1)\r\n    HTTPServerRequest(protocol='http', host='income-explainer-default.default.svc.cluster.local', method='POST', uri='/v1/models/income:explain', version='HTTP/1.1', remote_ip='127.0.0.1')\r\n    Traceback (most recent call last):\r\n      File \"/usr/local/lib/python3.7/site-packages/tornado/web.py\", line 1701, in _execute\r\n        result = method(*self.path_args, **self.path_kwargs)\r\n      File \"/kfserving/kfserving/handlers/http.py\", line 61, in post\r\n        response = model.explain(request)\r\n      File \"/alibiexplainer/alibiexplainer/explainer.py\", line 74, in explain\r\n        explanation = self.wrapper.explain(request[\"instances\"])\r\n      File \"/alibiexplainer/alibiexplainer/anchor_tabular.py\", line 89, in explain\r\n        anchor_exp = self.anchors_tabular.explain(arr[0], **self.kwargs)\r\n      File \"/usr/local/lib/python3.7/site-packages/alibi/explainers/anchor_tabular.py\", line 803, in explain\r\n        for sampler in self.samplers:\r\n    AttributeError: 'AnchorTabular' object has no attribute 'samplers'\r\n[E 200605 17:15:14 web:2250] 500 POST /v1/models/income:explain (127.0.0.1) 58.80ms\r\n[I 200605 17:18:22 anchor_tabular:83] Arr shape ((1, 12),) \r\n[E 200605 17:18:22 web:1792] Uncaught exception POST /v1/models/income:explain (127.0.0.1)\r\n    HTTPServerRequest(protocol='http', host='income-explainer-default.default.svc.cluster.local', method='POST', uri='/v1/models/income:explain', version='HTTP/1.1', remote_ip='127.0.0.1')\r\n    Traceback (most recent call last):\r\n      File \"/usr/local/lib/python3.7/site-packages/tornado/web.py\", line 1701, in _execute\r\n        result = method(*self.path_args, **self.path_kwargs)\r\n      File \"/kfserving/kfserving/handlers/http.py\", line 61, in post\r\n        response = model.explain(request)\r\n      File \"/alibiexplainer/alibiexplainer/explainer.py\", line 74, in explain\r\n        explanation = self.wrapper.explain(request[\"instances\"])\r\n      File \"/alibiexplainer/alibiexplainer/anchor_tabular.py\", line 89, in explain\r\n        anchor_exp = self.anchors_tabular.explain(arr[0], **self.kwargs)\r\n      File \"/usr/local/lib/python3.7/site-packages/alibi/explainers/anchor_tabular.py\", line 803, in explain\r\n        for sampler in self.samplers:\r\n    AttributeError: 'AnchorTabular' object has no attribute 'samplers'\r\n[E 200605 17:18:22 web:2250] 500 POST /v1/models/income:explain (127.0.0.1) 31.17ms\r\n\r\n```\r\n\r\nPresumably it would work on master. Does that sound right @cliveseldon ? If so maybe we should just close this.\n", "before_files": [{"content": "# Copyright 2019 kubeflow.org.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#    http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom setuptools import setup, find_packages\n\ntests_require = [\n    'pytest',\n    'pytest-tornasync',\n    'mypy'\n]\n\nsetup(\n    name='alibiexplainer',\n    version='0.3.0',\n    author_email='cc@seldon.io',\n    license='../../LICENSE.txt',\n    url='https://github.com/kubeflow/kfserving/python/kfserving/alibiexplainer',\n    description='Model Explaination Server. \\\n                 Not intended for use outside KFServing Frameworks Images',\n    long_description=open('README.md').read(),\n    python_requires='>=3.6',\n    packages=find_packages(\"alibiexplainer\"),\n    install_requires=[\n        \"kfserving>=0.3.0\",\n        \"alibi>=0.3\",\n        \"scikit-learn>=0.20.3\",\n        \"argparse>=1.4.0\",\n        \"requests>=2.22.0\",\n        \"joblib>=0.13.2\",\n        \"pandas>=0.24.2\",\n        \"numpy>=1.16.3\",\n        \"dill>=0.3.0\",\n        \"spacy>=2.1.4\"\n    ],\n    tests_require=tests_require,\n    extras_require={'test': tests_require}\n)\n", "path": "python/alibiexplainer/setup.py"}]}