prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  syntax error in util/deprecation.py
  line 24:
      message += " " + extra.trim()
  results in error: AttributeError: 'str' object has no attribute 'trim'
  
  it should be instead:
      message += " " + extra.strip()
  
  that fixes the problem.  I needed that change to get the happiness demo to run
  
  Helmut Strey
  
  
  </issue>
  <code>
  [start of bokeh/util/deprecation.py]
  1 import six
  2 import warnings
  3 
  4 class BokehDeprecationWarning(DeprecationWarning):
  5     """ A specific ``DeprecationWarning`` subclass for Bokeh deprecations.
  6     Used to selectively filter Bokeh deprecations for unconditional display.
  7 
  8     """
  9 
  10 def warn(message, stacklevel=2):
  11     warnings.warn(message, BokehDeprecationWarning, stacklevel=stacklevel)
  12 
  13 def deprecated(since_or_msg, old=None, new=None, extra=None):
  14     """ Issue a nicely formatted deprecation warning. """
  15 
  16     if isinstance(since_or_msg, tuple):
  17         if old is None or new is None:
  18             raise ValueError("deprecated entity and a replacement are required")
  19 
  20         since = "%d.%d.%d" % since_or_msg
  21         message = "%(old)s was deprecated in Bokeh %(since)s and will be removed, use %(new)s instead."
  22         message = message % dict(old=old, since=since, new=new)
  23         if extra is not None:
  24             message += " " + extra.trim()
  25     elif isinstance(since_or_msg, six.string_types):
  26         if not (old is None and new is None and extra is None):
  27             raise ValueError("deprecated(message) signature doesn't allow extra arguments")
  28 
  29         message = since_or_msg
  30     else:
  31         raise ValueError("expected a version tuple or string message")
  32 
  33     warn(message)
  34
  [end of bokeh/util/deprecation.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/bokeh/util/deprecation.py b/bokeh/util/deprecation.py
  --- a/bokeh/util/deprecation.py
  +++ b/bokeh/util/deprecation.py
  @@ -17,11 +17,14 @@
           if old is None or new is None:
               raise ValueError("deprecated entity and a replacement are required")
   
  +        if len(since_or_msg) != 3 or not all(isinstance(x, int) and x >=0 for x in since_or_msg):
  +            raise ValueError("invalid version tuple: %r" % (since_or_msg,))
  +
           since = "%d.%d.%d" % since_or_msg
           message = "%(old)s was deprecated in Bokeh %(since)s and will be removed, use %(new)s instead."
           message = message % dict(old=old, since=since, new=new)
           if extra is not None:
  -            message += " " + extra.trim()
  +            message += " " + extra.strip()
       elif isinstance(since_or_msg, six.string_types):
           if not (old is None and new is None and extra is None):
               raise ValueError("deprecated(message) signature doesn't allow extra arguments")
  
verification_info: {"golden_diff": "diff --git a/bokeh/util/deprecation.py b/bokeh/util/deprecation.py\n--- a/bokeh/util/deprecation.py\n+++ b/bokeh/util/deprecation.py\n@@ -17,11 +17,14 @@\n         if old is None or new is None:\n             raise ValueError(\"deprecated entity and a replacement are required\")\n \n+        if len(since_or_msg) != 3 or not all(isinstance(x, int) and x >=0 for x in since_or_msg):\n+            raise ValueError(\"invalid version tuple: %r\" % (since_or_msg,))\n+\n         since = \"%d.%d.%d\" % since_or_msg\n         message = \"%(old)s was deprecated in Bokeh %(since)s and will be removed, use %(new)s instead.\"\n         message = message % dict(old=old, since=since, new=new)\n         if extra is not None:\n-            message += \" \" + extra.trim()\n+            message += \" \" + extra.strip()\n     elif isinstance(since_or_msg, six.string_types):\n         if not (old is None and new is None and extra is None):\n             raise ValueError(\"deprecated(message) signature doesn't allow extra arguments\")\n", "issue": "syntax error in util/deprecation.py\nline 24:\n    message += \" \" + extra.trim()\nresults in error: AttributeError: 'str' object has no attribute 'trim'\n\nit should be instead:\n    message += \" \" + extra.strip()\n\nthat fixes the problem.  I needed that change to get the happiness demo to run\n\nHelmut Strey\n\n", "before_files": [{"content": "import six\nimport warnings\n\nclass BokehDeprecationWarning(DeprecationWarning):\n    \"\"\" A specific ``DeprecationWarning`` subclass for Bokeh deprecations.\n    Used to selectively filter Bokeh deprecations for unconditional display.\n\n    \"\"\"\n\ndef warn(message, stacklevel=2):\n    warnings.warn(message, BokehDeprecationWarning, stacklevel=stacklevel)\n\ndef deprecated(since_or_msg, old=None, new=None, extra=None):\n    \"\"\" Issue a nicely formatted deprecation warning. \"\"\"\n\n    if isinstance(since_or_msg, tuple):\n        if old is None or new is None:\n            raise ValueError(\"deprecated entity and a replacement are required\")\n\n        since = \"%d.%d.%d\" % since_or_msg\n        message = \"%(old)s was deprecated in Bokeh %(since)s and will be removed, use %(new)s instead.\"\n        message = message % dict(old=old, since=since, new=new)\n        if extra is not None:\n            message += \" \" + extra.trim()\n    elif isinstance(since_or_msg, six.string_types):\n        if not (old is None and new is None and extra is None):\n            raise ValueError(\"deprecated(message) signature doesn't allow extra arguments\")\n\n        message = since_or_msg\n    else:\n        raise ValueError(\"expected a version tuple or string message\")\n\n    warn(message)\n", "path": "bokeh/util/deprecation.py"}]}