prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Unclear which `HTTPError` was instantiated from `deprecated_args()` warnings
  In Falcon 3.0.x, instantiating `HTTPError` or its subclasses with positional arguments (of course except the allowed ones) generates a `DeprecatedWarning` via the `deprecated_args()` decorator.
  
  However, it is unclear from the warning which class/function was invoked, it just says "calls [with more than N] positional args are deprecated". Brought up by @laurent-chriqui (see the linked PR).
  
  Ideally, as a developer, I would like the warning to read along the lines of
  ```
  DeprecatedWarning: Calls to HTTPNotFound.__init__(...) with positional args are deprecated. Please specify them as keyword arguments instead.
  ```
  
  </issue>
  <code>
  [start of falcon/util/deprecation.py]
  1 # Copyright 2013 by Rackspace Hosting, Inc.
  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 """Miscellaneous deprecation utilities.
  16 
  17 This module provides decorators to mark functions and classes as deprecated.
  18 """
  19 
  20 import functools
  21 import warnings
  22 
  23 
  24 __all__ = (
  25     'DeprecatedWarning',
  26     'deprecated',
  27     'deprecated_args',
  28 )
  29 
  30 
  31 # NOTE(kgriffs): We don't want our deprecations to be ignored by default,
  32 # so create our own type.
  33 #
  34 # TODO(kgriffs): Revisit this decision if users complain.
  35 class DeprecatedWarning(UserWarning):
  36     pass
  37 
  38 
  39 def deprecated(instructions, is_property=False, method_name=None):
  40     """Flag a method as deprecated.
  41 
  42     This function returns a decorator which can be used to mark deprecated
  43     functions. Applying this decorator will result in a warning being
  44     emitted when the function is used.
  45 
  46     Args:
  47         instructions (str): Specific guidance for the developer, e.g.:
  48             'Please migrate to add_proxy(...)'.
  49         is_property (bool): If the deprecated object is a property. It
  50             will omit the ``(...)`` from the generated documentation.
  51         method_name (str, optional): Set to override the name of the
  52             deprecated function or property in the generated
  53             documentation (default ``None``). This is useful when
  54             decorating an alias that carries the target's ``__name__``.
  55 
  56     """
  57 
  58     def decorator(func):
  59 
  60         object_name = 'property' if is_property else 'function'
  61         post_name = '' if is_property else '(...)'
  62         message = 'Call to deprecated {} {}{}. {}'.format(
  63             object_name, method_name or func.__name__, post_name, instructions
  64         )
  65 
  66         @functools.wraps(func)
  67         def wrapper(*args, **kwargs):
  68             warnings.warn(message, category=DeprecatedWarning, stacklevel=2)
  69 
  70             return func(*args, **kwargs)
  71 
  72         return wrapper
  73 
  74     return decorator
  75 
  76 
  77 def deprecated_args(*, allowed_positional, is_method=True):
  78     """Flag a method call with positional args as deprecated.
  79 
  80     Keyword Args:
  81         allowed_positional (int): Number of allowed positional arguments
  82         is_method (bool, optional): The decorated function is a method. Will
  83           add one to the number of allowed positional args to account for
  84           ``self``. Defaults to True.
  85     """
  86 
  87     template = (
  88         'Calls with{} positional args are deprecated.'
  89         ' Please specify them as keyword arguments instead.'
  90     )
  91     text = ' more than {}'.format(allowed_positional) if allowed_positional else ''
  92     warn_text = template.format(text)
  93     if is_method:
  94         allowed_positional += 1
  95 
  96     def deprecated_args(fn):
  97         @functools.wraps(fn)
  98         def wraps(*args, **kwargs):
  99             if len(args) > allowed_positional:
  100                 warnings.warn(warn_text, DeprecatedWarning, stacklevel=2)
  101             return fn(*args, **kwargs)
  102 
  103         return wraps
  104 
  105     return deprecated_args
  106
  [end of falcon/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/falcon/util/deprecation.py b/falcon/util/deprecation.py
  --- a/falcon/util/deprecation.py
  +++ b/falcon/util/deprecation.py
  @@ -85,11 +85,11 @@
       """
   
       template = (
  -        'Calls with{} positional args are deprecated.'
  +        'Calls to {{fn}}(...) with{arg_text} positional args are deprecated.'
           ' Please specify them as keyword arguments instead.'
       )
       text = ' more than {}'.format(allowed_positional) if allowed_positional else ''
  -    warn_text = template.format(text)
  +    warn_text = template.format(arg_text=text)
       if is_method:
           allowed_positional += 1
   
  @@ -97,7 +97,11 @@
           @functools.wraps(fn)
           def wraps(*args, **kwargs):
               if len(args) > allowed_positional:
  -                warnings.warn(warn_text, DeprecatedWarning, stacklevel=2)
  +                warnings.warn(
  +                    warn_text.format(fn=fn.__qualname__),
  +                    DeprecatedWarning,
  +                    stacklevel=2,
  +                )
               return fn(*args, **kwargs)
   
           return wraps
  
verification_info: {"golden_diff": "diff --git a/falcon/util/deprecation.py b/falcon/util/deprecation.py\n--- a/falcon/util/deprecation.py\n+++ b/falcon/util/deprecation.py\n@@ -85,11 +85,11 @@\n     \"\"\"\n \n     template = (\n-        'Calls with{} positional args are deprecated.'\n+        'Calls to {{fn}}(...) with{arg_text} positional args are deprecated.'\n         ' Please specify them as keyword arguments instead.'\n     )\n     text = ' more than {}'.format(allowed_positional) if allowed_positional else ''\n-    warn_text = template.format(text)\n+    warn_text = template.format(arg_text=text)\n     if is_method:\n         allowed_positional += 1\n \n@@ -97,7 +97,11 @@\n         @functools.wraps(fn)\n         def wraps(*args, **kwargs):\n             if len(args) > allowed_positional:\n-                warnings.warn(warn_text, DeprecatedWarning, stacklevel=2)\n+                warnings.warn(\n+                    warn_text.format(fn=fn.__qualname__),\n+                    DeprecatedWarning,\n+                    stacklevel=2,\n+                )\n             return fn(*args, **kwargs)\n \n         return wraps\n", "issue": "Unclear which `HTTPError` was instantiated from `deprecated_args()` warnings\nIn Falcon 3.0.x, instantiating `HTTPError` or its subclasses with positional arguments (of course except the allowed ones) generates a `DeprecatedWarning` via the `deprecated_args()` decorator.\r\n\r\nHowever, it is unclear from the warning which class/function was invoked, it just says \"calls [with more than N] positional args are deprecated\". Brought up by @laurent-chriqui (see the linked PR).\r\n\r\nIdeally, as a developer, I would like the warning to read along the lines of\r\n```\r\nDeprecatedWarning: Calls to HTTPNotFound.__init__(...) with positional args are deprecated. Please specify them as keyword arguments instead.\r\n```\n", "before_files": [{"content": "# Copyright 2013 by Rackspace Hosting, Inc.\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\n\"\"\"Miscellaneous deprecation utilities.\n\nThis module provides decorators to mark functions and classes as deprecated.\n\"\"\"\n\nimport functools\nimport warnings\n\n\n__all__ = (\n    'DeprecatedWarning',\n    'deprecated',\n    'deprecated_args',\n)\n\n\n# NOTE(kgriffs): We don't want our deprecations to be ignored by default,\n# so create our own type.\n#\n# TODO(kgriffs): Revisit this decision if users complain.\nclass DeprecatedWarning(UserWarning):\n    pass\n\n\ndef deprecated(instructions, is_property=False, method_name=None):\n    \"\"\"Flag a method as deprecated.\n\n    This function returns a decorator which can be used to mark deprecated\n    functions. Applying this decorator will result in a warning being\n    emitted when the function is used.\n\n    Args:\n        instructions (str): Specific guidance for the developer, e.g.:\n            'Please migrate to add_proxy(...)'.\n        is_property (bool): If the deprecated object is a property. It\n            will omit the ``(...)`` from the generated documentation.\n        method_name (str, optional): Set to override the name of the\n            deprecated function or property in the generated\n            documentation (default ``None``). This is useful when\n            decorating an alias that carries the target's ``__name__``.\n\n    \"\"\"\n\n    def decorator(func):\n\n        object_name = 'property' if is_property else 'function'\n        post_name = '' if is_property else '(...)'\n        message = 'Call to deprecated {} {}{}. {}'.format(\n            object_name, method_name or func.__name__, post_name, instructions\n        )\n\n        @functools.wraps(func)\n        def wrapper(*args, **kwargs):\n            warnings.warn(message, category=DeprecatedWarning, stacklevel=2)\n\n            return func(*args, **kwargs)\n\n        return wrapper\n\n    return decorator\n\n\ndef deprecated_args(*, allowed_positional, is_method=True):\n    \"\"\"Flag a method call with positional args as deprecated.\n\n    Keyword Args:\n        allowed_positional (int): Number of allowed positional arguments\n        is_method (bool, optional): The decorated function is a method. Will\n          add one to the number of allowed positional args to account for\n          ``self``. Defaults to True.\n    \"\"\"\n\n    template = (\n        'Calls with{} positional args are deprecated.'\n        ' Please specify them as keyword arguments instead.'\n    )\n    text = ' more than {}'.format(allowed_positional) if allowed_positional else ''\n    warn_text = template.format(text)\n    if is_method:\n        allowed_positional += 1\n\n    def deprecated_args(fn):\n        @functools.wraps(fn)\n        def wraps(*args, **kwargs):\n            if len(args) > allowed_positional:\n                warnings.warn(warn_text, DeprecatedWarning, stacklevel=2)\n            return fn(*args, **kwargs)\n\n        return wraps\n\n    return deprecated_args\n", "path": "falcon/util/deprecation.py"}]}