prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Error messages not displaying long enough
  Currently error messages are displayed for only a period of time. They should be displayed until the user acknowledges the error. 
  
  
  </issue>
  <code>
  [start of lemur/common/utils.py]
  1 """
  2 .. module: lemur.common.utils
  3     :platform: Unix
  4     :copyright: (c) 2015 by Netflix Inc., see AUTHORS for more
  5     :license: Apache, see LICENSE for more details.
  6 
  7 .. moduleauthor:: Kevin Glisson <kglisson@netflix.com>
  8 """
  9 import string
  10 import random
  11 from functools import wraps
  12 
  13 from flask import current_app
  14 
  15 from flask.ext.restful import marshal
  16 from flask.ext.restful.reqparse import RequestParser
  17 from flask.ext.sqlalchemy import Pagination
  18 
  19 
  20 def get_psuedo_random_string():
  21     """
  22     Create a random and strongish challenge.
  23     """
  24     challenge = ''.join(random.choice(string.ascii_uppercase) for x in range(6))  # noqa
  25     challenge += ''.join(random.choice("~!@#$%^&*()_+") for x in range(6))  # noqa
  26     challenge += ''.join(random.choice(string.ascii_lowercase) for x in range(6))
  27     challenge += ''.join(random.choice(string.digits) for x in range(6))  # noqa
  28     return challenge
  29 
  30 
  31 class marshal_items(object):
  32     def __init__(self, fields, envelope=None):
  33         self.fields = fields
  34         self.envelop = envelope
  35 
  36     def __call__(self, f):
  37         def _filter_items(items):
  38             filtered_items = []
  39             for item in items:
  40                 filtered_items.append(marshal(item, self.fields))
  41             return filtered_items
  42 
  43         @wraps(f)
  44         def wrapper(*args, **kwargs):
  45             try:
  46                 resp = f(*args, **kwargs)
  47 
  48                 # this is a bit weird way to handle non standard error codes returned from the marshaled function
  49                 if isinstance(resp, tuple):
  50                     return resp[0], resp[1]
  51 
  52                 if isinstance(resp, Pagination):
  53                     return {'items': _filter_items(resp.items), 'total': resp.total}
  54 
  55                 if isinstance(resp, list):
  56                     return {'items': _filter_items(resp), 'total': len(resp)}
  57 
  58                 return marshal(resp, self.fields)
  59             except Exception as e:
  60                 current_app.logger.exception(e)
  61                 # this is a little weird hack to respect flask restful parsing errors on marshaled functions
  62                 if hasattr(e, 'code'):
  63                     if hasattr(e, 'data'):
  64                         return {'message': e.data['message']}, 400
  65                     else:
  66                         return {'message': 'unknown'}, 400
  67                 else:
  68                     return {'message': str(e)}, 400
  69         return wrapper
  70 
  71 
  72 paginated_parser = RequestParser()
  73 
  74 paginated_parser.add_argument('count', type=int, default=10, location='args')
  75 paginated_parser.add_argument('page', type=int, default=1, location='args')
  76 paginated_parser.add_argument('sortDir', type=str, dest='sort_dir', location='args')
  77 paginated_parser.add_argument('sortBy', type=str, dest='sort_by', location='args')
  78 paginated_parser.add_argument('filter', type=str, location='args')
  79
  [end of lemur/common/utils.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/lemur/common/utils.py b/lemur/common/utils.py
  --- a/lemur/common/utils.py
  +++ b/lemur/common/utils.py
  @@ -63,9 +63,9 @@
                       if hasattr(e, 'data'):
                           return {'message': e.data['message']}, 400
                       else:
  -                        return {'message': 'unknown'}, 400
  +                        return {'message': {'exception': 'unknown'}}, 400
                   else:
  -                    return {'message': str(e)}, 400
  +                    return {'message': {'exception': str(e)}}, 400
           return wrapper
  
verification_info: {"golden_diff": "diff --git a/lemur/common/utils.py b/lemur/common/utils.py\n--- a/lemur/common/utils.py\n+++ b/lemur/common/utils.py\n@@ -63,9 +63,9 @@\n                     if hasattr(e, 'data'):\n                         return {'message': e.data['message']}, 400\n                     else:\n-                        return {'message': 'unknown'}, 400\n+                        return {'message': {'exception': 'unknown'}}, 400\n                 else:\n-                    return {'message': str(e)}, 400\n+                    return {'message': {'exception': str(e)}}, 400\n         return wrapper\n", "issue": "Error messages not displaying long enough\nCurrently error messages are displayed for only a period of time. They should be displayed until the user acknowledges the error. \n\n", "before_files": [{"content": "\"\"\"\n.. module: lemur.common.utils\n    :platform: Unix\n    :copyright: (c) 2015 by Netflix Inc., see AUTHORS for more\n    :license: Apache, see LICENSE for more details.\n\n.. moduleauthor:: Kevin Glisson <kglisson@netflix.com>\n\"\"\"\nimport string\nimport random\nfrom functools import wraps\n\nfrom flask import current_app\n\nfrom flask.ext.restful import marshal\nfrom flask.ext.restful.reqparse import RequestParser\nfrom flask.ext.sqlalchemy import Pagination\n\n\ndef get_psuedo_random_string():\n    \"\"\"\n    Create a random and strongish challenge.\n    \"\"\"\n    challenge = ''.join(random.choice(string.ascii_uppercase) for x in range(6))  # noqa\n    challenge += ''.join(random.choice(\"~!@#$%^&*()_+\") for x in range(6))  # noqa\n    challenge += ''.join(random.choice(string.ascii_lowercase) for x in range(6))\n    challenge += ''.join(random.choice(string.digits) for x in range(6))  # noqa\n    return challenge\n\n\nclass marshal_items(object):\n    def __init__(self, fields, envelope=None):\n        self.fields = fields\n        self.envelop = envelope\n\n    def __call__(self, f):\n        def _filter_items(items):\n            filtered_items = []\n            for item in items:\n                filtered_items.append(marshal(item, self.fields))\n            return filtered_items\n\n        @wraps(f)\n        def wrapper(*args, **kwargs):\n            try:\n                resp = f(*args, **kwargs)\n\n                # this is a bit weird way to handle non standard error codes returned from the marshaled function\n                if isinstance(resp, tuple):\n                    return resp[0], resp[1]\n\n                if isinstance(resp, Pagination):\n                    return {'items': _filter_items(resp.items), 'total': resp.total}\n\n                if isinstance(resp, list):\n                    return {'items': _filter_items(resp), 'total': len(resp)}\n\n                return marshal(resp, self.fields)\n            except Exception as e:\n                current_app.logger.exception(e)\n                # this is a little weird hack to respect flask restful parsing errors on marshaled functions\n                if hasattr(e, 'code'):\n                    if hasattr(e, 'data'):\n                        return {'message': e.data['message']}, 400\n                    else:\n                        return {'message': 'unknown'}, 400\n                else:\n                    return {'message': str(e)}, 400\n        return wrapper\n\n\npaginated_parser = RequestParser()\n\npaginated_parser.add_argument('count', type=int, default=10, location='args')\npaginated_parser.add_argument('page', type=int, default=1, location='args')\npaginated_parser.add_argument('sortDir', type=str, dest='sort_dir', location='args')\npaginated_parser.add_argument('sortBy', type=str, dest='sort_by', location='args')\npaginated_parser.add_argument('filter', type=str, location='args')\n", "path": "lemur/common/utils.py"}]}