prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Endpoint to return handler's icons
  At the moment we return icons for handlers by general `GET /handlers` route. Icons are return in svg or base64, which is not effective. We need new endpoint to return handler icon:
  `GET /handlers/{name}/icon/{icon_file_name}`
  
  
  </issue>
  <code>
  [start of mindsdb/api/http/namespaces/handlers.py]
  1 from flask import request
  2 from flask_restx import Resource
  3 
  4 from mindsdb.api.http.utils import http_error
  5 from mindsdb.api.http.namespaces.configs.handlers import ns_conf
  6 from mindsdb.integrations.utilities.install import install_dependencies
  7 
  8 
  9 @ns_conf.route('/')
  10 class HandlersList(Resource):
  11     @ns_conf.doc('handlers_list')
  12     def get(self):
  13         '''List all db handlers'''
  14         handlers = request.integration_controller.get_handlers_import_status()
  15         result = []
  16         for handler_type, handler_meta in handlers.items():
  17             row = {'name': handler_type}
  18             row.update(handler_meta)
  19             result.append(row)
  20         return result
  21 
  22 
  23 @ns_conf.route('/<handler_name>/install')
  24 class InstallDependencies(Resource):
  25     @ns_conf.param('handler_name', 'Handler name')
  26     def post(self, handler_name):
  27         handler_import_status = request.integration_controller.get_handlers_import_status()
  28         if handler_name not in handler_import_status:
  29             return f'Unkown handler: {handler_name}', 400
  30 
  31         if handler_import_status[handler_name].get('import', {}).get('success', False) is True:
  32             return 'Installed', 200
  33 
  34         handler_meta = handler_import_status[handler_name]
  35 
  36         dependencies = handler_meta['import']['dependencies']
  37         if len(dependencies) == 0:
  38             return 'Installed', 200
  39 
  40         result = install_dependencies(dependencies)
  41 
  42         # reload it if any result, so we can get new error message
  43         request.integration_controller.reload_handler_module(handler_name)
  44         if result.get('success') is True:
  45             return '', 200
  46         return http_error(
  47             500,
  48             'Failed to install dependency',
  49             result.get('error_message', 'unknown error')
  50         )
  51
  [end of mindsdb/api/http/namespaces/handlers.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/mindsdb/api/http/namespaces/handlers.py b/mindsdb/api/http/namespaces/handlers.py
  --- a/mindsdb/api/http/namespaces/handlers.py
  +++ b/mindsdb/api/http/namespaces/handlers.py
  @@ -1,4 +1,8 @@
  -from flask import request
  +import os
  +import importlib
  +from pathlib import Path
  +
  +from flask import request, send_file, abort
   from flask_restx import Resource
   
   from mindsdb.api.http.utils import http_error
  @@ -20,6 +24,24 @@
           return result
   
   
  +@ns_conf.route('/<handler_name>/icon')
  +class HandlerIcon(Resource):
  +    @ns_conf.param('handler_name', 'Handler name')
  +    def get(self, handler_name):
  +        try:
  +            handlers_import_status = request.integration_controller.get_handlers_import_status()
  +            icon_name = handlers_import_status[handler_name]['icon']['name']
  +            handler_folder = handlers_import_status[handler_name]['import']['folder']
  +            mindsdb_path = Path(importlib.util.find_spec('mindsdb').origin).parent
  +            icon_path = mindsdb_path.joinpath('integrations/handlers').joinpath(handler_folder).joinpath(icon_name)
  +            if icon_path.is_absolute() is False:
  +                icon_path = Path(os.getcwd()).joinpath(icon_path)
  +        except Exception:
  +            return abort(404)
  +        else:
  +            return send_file(icon_path)
  +
  +
   @ns_conf.route('/<handler_name>/install')
   class InstallDependencies(Resource):
       @ns_conf.param('handler_name', 'Handler name')
  
verification_info: {"golden_diff": "diff --git a/mindsdb/api/http/namespaces/handlers.py b/mindsdb/api/http/namespaces/handlers.py\n--- a/mindsdb/api/http/namespaces/handlers.py\n+++ b/mindsdb/api/http/namespaces/handlers.py\n@@ -1,4 +1,8 @@\n-from flask import request\n+import os\n+import importlib\n+from pathlib import Path\n+\n+from flask import request, send_file, abort\n from flask_restx import Resource\n \n from mindsdb.api.http.utils import http_error\n@@ -20,6 +24,24 @@\n         return result\n \n \n+@ns_conf.route('/<handler_name>/icon')\n+class HandlerIcon(Resource):\n+    @ns_conf.param('handler_name', 'Handler name')\n+    def get(self, handler_name):\n+        try:\n+            handlers_import_status = request.integration_controller.get_handlers_import_status()\n+            icon_name = handlers_import_status[handler_name]['icon']['name']\n+            handler_folder = handlers_import_status[handler_name]['import']['folder']\n+            mindsdb_path = Path(importlib.util.find_spec('mindsdb').origin).parent\n+            icon_path = mindsdb_path.joinpath('integrations/handlers').joinpath(handler_folder).joinpath(icon_name)\n+            if icon_path.is_absolute() is False:\n+                icon_path = Path(os.getcwd()).joinpath(icon_path)\n+        except Exception:\n+            return abort(404)\n+        else:\n+            return send_file(icon_path)\n+\n+\n @ns_conf.route('/<handler_name>/install')\n class InstallDependencies(Resource):\n     @ns_conf.param('handler_name', 'Handler name')\n", "issue": "Endpoint to return handler's icons\nAt the moment we return icons for handlers by general `GET /handlers` route. Icons are return in svg or base64, which is not effective. We need new endpoint to return handler icon:\r\n`GET /handlers/{name}/icon/{icon_file_name}`\r\n\n", "before_files": [{"content": "from flask import request\nfrom flask_restx import Resource\n\nfrom mindsdb.api.http.utils import http_error\nfrom mindsdb.api.http.namespaces.configs.handlers import ns_conf\nfrom mindsdb.integrations.utilities.install import install_dependencies\n\n\n@ns_conf.route('/')\nclass HandlersList(Resource):\n    @ns_conf.doc('handlers_list')\n    def get(self):\n        '''List all db handlers'''\n        handlers = request.integration_controller.get_handlers_import_status()\n        result = []\n        for handler_type, handler_meta in handlers.items():\n            row = {'name': handler_type}\n            row.update(handler_meta)\n            result.append(row)\n        return result\n\n\n@ns_conf.route('/<handler_name>/install')\nclass InstallDependencies(Resource):\n    @ns_conf.param('handler_name', 'Handler name')\n    def post(self, handler_name):\n        handler_import_status = request.integration_controller.get_handlers_import_status()\n        if handler_name not in handler_import_status:\n            return f'Unkown handler: {handler_name}', 400\n\n        if handler_import_status[handler_name].get('import', {}).get('success', False) is True:\n            return 'Installed', 200\n\n        handler_meta = handler_import_status[handler_name]\n\n        dependencies = handler_meta['import']['dependencies']\n        if len(dependencies) == 0:\n            return 'Installed', 200\n\n        result = install_dependencies(dependencies)\n\n        # reload it if any result, so we can get new error message\n        request.integration_controller.reload_handler_module(handler_name)\n        if result.get('success') is True:\n            return '', 200\n        return http_error(\n            500,\n            'Failed to install dependency',\n            result.get('error_message', 'unknown error')\n        )\n", "path": "mindsdb/api/http/namespaces/handlers.py"}]}