We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Timer.__iter__'s docstring is error.
``kombu.async.timer.Timer.__iter__`` yields a tuple of ``(wait_seconds, entry)``, not ``(entry, wait_seconds)``.

Should I provide pr to fix such small problem?
As a newcomer, I don't know if this is appropriate?

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `kombu/async/timer.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 """Timer scheduling Python callbacks."""
3 from __future__ import absolute_import, unicode_literals
4 
5 import heapq
6 import sys
7 
8 from collections import namedtuple
9 from datetime import datetime
10 from functools import total_ordering
11 from weakref import proxy as weakrefproxy
12 
13 from vine.utils import wraps
14 
15 from kombu.five import monotonic, python_2_unicode_compatible
16 from kombu.log import get_logger
17 from time import time as _time
18 
19 try:
20     from pytz import utc
21 except ImportError:  # pragma: no cover
22     utc = None
23 
24 __all__ = ['Entry', 'Timer', 'to_timestamp']
25 
26 logger = get_logger(__name__)
27 
28 DEFAULT_MAX_INTERVAL = 2
29 EPOCH = datetime.utcfromtimestamp(0).replace(tzinfo=utc)
30 IS_PYPY = hasattr(sys, 'pypy_version_info')
31 
32 scheduled = namedtuple('scheduled', ('eta', 'priority', 'entry'))
33 
34 
35 def to_timestamp(d, default_timezone=utc, time=monotonic):
36     """Convert datetime to timestamp.
37 
38     If d' is already a timestamp, then that will be used.
39     """
40     if isinstance(d, datetime):
41         if d.tzinfo is None:
42             d = d.replace(tzinfo=default_timezone)
43         diff = _time() - time()
44         return max((d - EPOCH).total_seconds() - diff, 0)
45     return d
46 
47 
48 @total_ordering
49 @python_2_unicode_compatible
50 class Entry(object):
51     """Schedule Entry."""
52 
53     if not IS_PYPY:  # pragma: no cover
54         __slots__ = (
55             'fun', 'args', 'kwargs', 'tref', 'canceled',
56             '_last_run', '__weakref__',
57         )
58 
59     def __init__(self, fun, args=None, kwargs=None):
60         self.fun = fun
61         self.args = args or []
62         self.kwargs = kwargs or {}
63         self.tref = weakrefproxy(self)
64         self._last_run = None
65         self.canceled = False
66 
67     def __call__(self):
68         return self.fun(*self.args, **self.kwargs)
69 
70     def cancel(self):
71         try:
72             self.tref.canceled = True
73         except ReferenceError:  # pragma: no cover
74             pass
75 
76     def __repr__(self):
77         return '<TimerEntry: {0}(*{1!r}, **{2!r})'.format(
78             self.fun.__name__, self.args, self.kwargs)
79 
80     # must not use hash() to order entries
81     def __lt__(self, other):
82         return id(self) < id(other)
83 
84     @property
85     def cancelled(self):
86         return self.canceled
87 
88     @cancelled.setter
89     def cancelled(self, value):
90         self.canceled = value
91 
92 
93 class Timer(object):
94     """Async timer implementation."""
95 
96     Entry = Entry
97 
98     on_error = None
99 
100     def __init__(self, max_interval=None, on_error=None, **kwargs):
101         self.max_interval = float(max_interval or DEFAULT_MAX_INTERVAL)
102         self.on_error = on_error or self.on_error
103         self._queue = []
104 
105     def __enter__(self):
106         return self
107 
108     def __exit__(self, *exc_info):
109         self.stop()
110 
111     def call_at(self, eta, fun, args=(), kwargs={}, priority=0):
112         return self.enter_at(self.Entry(fun, args, kwargs), eta, priority)
113 
114     def call_after(self, secs, fun, args=(), kwargs={}, priority=0):
115         return self.enter_after(secs, self.Entry(fun, args, kwargs), priority)
116 
117     def call_repeatedly(self, secs, fun, args=(), kwargs={}, priority=0):
118         tref = self.Entry(fun, args, kwargs)
119 
120         @wraps(fun)
121         def _reschedules(*args, **kwargs):
122             last, now = tref._last_run, monotonic()
123             lsince = (now - tref._last_run) if last else secs
124             try:
125                 if lsince and lsince >= secs:
126                     tref._last_run = now
127                     return fun(*args, **kwargs)
128             finally:
129                 if not tref.canceled:
130                     last = tref._last_run
131                     next = secs - (now - last) if last else secs
132                     self.enter_after(next, tref, priority)
133 
134         tref.fun = _reschedules
135         tref._last_run = None
136         return self.enter_after(secs, tref, priority)
137 
138     def enter_at(self, entry, eta=None, priority=0, time=monotonic):
139         """Enter function into the scheduler.
140 
141         Arguments:
142             entry (~kombu.async.timer.Entry): Item to enter.
143             eta (datetime.datetime): Scheduled time.
144             priority (int): Unused.
145         """
146         if eta is None:
147             eta = time()
148         if isinstance(eta, datetime):
149             try:
150                 eta = to_timestamp(eta)
151             except Exception as exc:
152                 if not self.handle_error(exc):
153                     raise
154                 return
155         return self._enter(eta, priority, entry)
156 
157     def enter_after(self, secs, entry, priority=0, time=monotonic):
158         return self.enter_at(entry, time() + secs, priority)
159 
160     def _enter(self, eta, priority, entry, push=heapq.heappush):
161         push(self._queue, scheduled(eta, priority, entry))
162         return entry
163 
164     def apply_entry(self, entry):
165         try:
166             entry()
167         except Exception as exc:
168             if not self.handle_error(exc):
169                 logger.error('Error in timer: %r', exc, exc_info=True)
170 
171     def handle_error(self, exc_info):
172         if self.on_error:
173             self.on_error(exc_info)
174             return True
175 
176     def stop(self):
177         pass
178 
179     def __iter__(self, min=min, nowfun=monotonic,
180                  pop=heapq.heappop, push=heapq.heappush):
181         """Iterate over schedule.
182 
183         This iterator yields a tuple of ``(entry, wait_seconds)``,
184         where if entry is :const:`None` the caller should wait
185         for ``wait_seconds`` until it polls the schedule again.
186         """
187         max_interval = self.max_interval
188         queue = self._queue
189 
190         while 1:
191             if queue:
192                 eventA = queue[0]
193                 now, eta = nowfun(), eventA[0]
194 
195                 if now < eta:
196                     yield min(eta - now, max_interval), None
197                 else:
198                     eventB = pop(queue)
199 
200                     if eventB is eventA:
201                         entry = eventA[2]
202                         if not entry.canceled:
203                             yield None, entry
204                         continue
205                     else:
206                         push(queue, eventB)
207             else:
208                 yield None, None
209 
210     def clear(self):
211         self._queue[:] = []  # atomic, without creating a new list.
212 
213     def cancel(self, tref):
214         tref.cancel()
215 
216     def __len__(self):
217         return len(self._queue)
218 
219     def __nonzero__(self):
220         return True
221 
222     @property
223     def queue(self, _pop=heapq.heappop):
224         """Snapshot of underlying datastructure."""
225         events = list(self._queue)
226         return [_pop(v) for v in [events] * len(events)]
227 
228     @property
229     def schedule(self):
230         return self
231
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/kombu/async/timer.py b/kombu/async/timer.py
--- a/kombu/async/timer.py
+++ b/kombu/async/timer.py
@@ -180,7 +180,7 @@
                  pop=heapq.heappop, push=heapq.heappush):
         """Iterate over schedule.
 
-        This iterator yields a tuple of ``(entry, wait_seconds)``,
+        This iterator yields a tuple of ``(wait_seconds, entry)``,
         where if entry is :const:`None` the caller should wait
         for ``wait_seconds`` until it polls the schedule again.
         """

{"golden_diff": "diff --git a/kombu/async/timer.py b/kombu/async/timer.py\n--- a/kombu/async/timer.py\n+++ b/kombu/async/timer.py\n@@ -180,7 +180,7 @@\n                  pop=heapq.heappop, push=heapq.heappush):\n         \"\"\"Iterate over schedule.\n \n-        This iterator yields a tuple of ``(entry, wait_seconds)``,\n+        This iterator yields a tuple of ``(wait_seconds, entry)``,\n         where if entry is :const:`None` the caller should wait\n         for ``wait_seconds`` until it polls the schedule again.\n         \"\"\"\n", "issue": "Timer.__iter__'s docstring is error.\n``kombu.async.timer.Timer.__iter__`` yields a tuple of ``(wait_seconds, entry)``, not ``(entry, wait_seconds)``.\r\n\r\nShould I provide pr to fix such small problem?\r\nAs a newcomer, I don't know if this is appropriate?\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n\"\"\"Timer scheduling Python callbacks.\"\"\"\nfrom __future__ import absolute_import, unicode_literals\n\nimport heapq\nimport sys\n\nfrom collections import namedtuple\nfrom datetime import datetime\nfrom functools import total_ordering\nfrom weakref import proxy as weakrefproxy\n\nfrom vine.utils import wraps\n\nfrom kombu.five import monotonic, python_2_unicode_compatible\nfrom kombu.log import get_logger\nfrom time import time as _time\n\ntry:\n    from pytz import utc\nexcept ImportError:  # pragma: no cover\n    utc = None\n\n__all__ = ['Entry', 'Timer', 'to_timestamp']\n\nlogger = get_logger(__name__)\n\nDEFAULT_MAX_INTERVAL = 2\nEPOCH = datetime.utcfromtimestamp(0).replace(tzinfo=utc)\nIS_PYPY = hasattr(sys, 'pypy_version_info')\n\nscheduled = namedtuple('scheduled', ('eta', 'priority', 'entry'))\n\n\ndef to_timestamp(d, default_timezone=utc, time=monotonic):\n    \"\"\"Convert datetime to timestamp.\n\n    If d' is already a timestamp, then that will be used.\n    \"\"\"\n    if isinstance(d, datetime):\n        if d.tzinfo is None:\n            d = d.replace(tzinfo=default_timezone)\n        diff = _time() - time()\n        return max((d - EPOCH).total_seconds() - diff, 0)\n    return d\n\n\n@total_ordering\n@python_2_unicode_compatible\nclass Entry(object):\n    \"\"\"Schedule Entry.\"\"\"\n\n    if not IS_PYPY:  # pragma: no cover\n        __slots__ = (\n            'fun', 'args', 'kwargs', 'tref', 'canceled',\n            '_last_run', '__weakref__',\n        )\n\n    def __init__(self, fun, args=None, kwargs=None):\n        self.fun = fun\n        self.args = args or []\n        self.kwargs = kwargs or {}\n        self.tref = weakrefproxy(self)\n        self._last_run = None\n        self.canceled = False\n\n    def __call__(self):\n        return self.fun(*self.args, **self.kwargs)\n\n    def cancel(self):\n        try:\n            self.tref.canceled = True\n        except ReferenceError:  # pragma: no cover\n            pass\n\n    def __repr__(self):\n        return '<TimerEntry: {0}(*{1!r}, **{2!r})'.format(\n            self.fun.__name__, self.args, self.kwargs)\n\n    # must not use hash() to order entries\n    def __lt__(self, other):\n        return id(self) < id(other)\n\n    @property\n    def cancelled(self):\n        return self.canceled\n\n    @cancelled.setter\n    def cancelled(self, value):\n        self.canceled = value\n\n\nclass Timer(object):\n    \"\"\"Async timer implementation.\"\"\"\n\n    Entry = Entry\n\n    on_error = None\n\n    def __init__(self, max_interval=None, on_error=None, **kwargs):\n        self.max_interval = float(max_interval or DEFAULT_MAX_INTERVAL)\n        self.on_error = on_error or self.on_error\n        self._queue = []\n\n    def __enter__(self):\n        return self\n\n    def __exit__(self, *exc_info):\n        self.stop()\n\n    def call_at(self, eta, fun, args=(), kwargs={}, priority=0):\n        return self.enter_at(self.Entry(fun, args, kwargs), eta, priority)\n\n    def call_after(self, secs, fun, args=(), kwargs={}, priority=0):\n        return self.enter_after(secs, self.Entry(fun, args, kwargs), priority)\n\n    def call_repeatedly(self, secs, fun, args=(), kwargs={}, priority=0):\n        tref = self.Entry(fun, args, kwargs)\n\n        @wraps(fun)\n        def _reschedules(*args, **kwargs):\n            last, now = tref._last_run, monotonic()\n            lsince = (now - tref._last_run) if last else secs\n            try:\n                if lsince and lsince >= secs:\n                    tref._last_run = now\n                    return fun(*args, **kwargs)\n            finally:\n                if not tref.canceled:\n                    last = tref._last_run\n                    next = secs - (now - last) if last else secs\n                    self.enter_after(next, tref, priority)\n\n        tref.fun = _reschedules\n        tref._last_run = None\n        return self.enter_after(secs, tref, priority)\n\n    def enter_at(self, entry, eta=None, priority=0, time=monotonic):\n        \"\"\"Enter function into the scheduler.\n\n        Arguments:\n            entry (~kombu.async.timer.Entry): Item to enter.\n            eta (datetime.datetime): Scheduled time.\n            priority (int): Unused.\n        \"\"\"\n        if eta is None:\n            eta = time()\n        if isinstance(eta, datetime):\n            try:\n                eta = to_timestamp(eta)\n            except Exception as exc:\n                if not self.handle_error(exc):\n                    raise\n                return\n        return self._enter(eta, priority, entry)\n\n    def enter_after(self, secs, entry, priority=0, time=monotonic):\n        return self.enter_at(entry, time() + secs, priority)\n\n    def _enter(self, eta, priority, entry, push=heapq.heappush):\n        push(self._queue, scheduled(eta, priority, entry))\n        return entry\n\n    def apply_entry(self, entry):\n        try:\n            entry()\n        except Exception as exc:\n            if not self.handle_error(exc):\n                logger.error('Error in timer: %r', exc, exc_info=True)\n\n    def handle_error(self, exc_info):\n        if self.on_error:\n            self.on_error(exc_info)\n            return True\n\n    def stop(self):\n        pass\n\n    def __iter__(self, min=min, nowfun=monotonic,\n                 pop=heapq.heappop, push=heapq.heappush):\n        \"\"\"Iterate over schedule.\n\n        This iterator yields a tuple of ``(entry, wait_seconds)``,\n        where if entry is :const:`None` the caller should wait\n        for ``wait_seconds`` until it polls the schedule again.\n        \"\"\"\n        max_interval = self.max_interval\n        queue = self._queue\n\n        while 1:\n            if queue:\n                eventA = queue[0]\n                now, eta = nowfun(), eventA[0]\n\n                if now < eta:\n                    yield min(eta - now, max_interval), None\n                else:\n                    eventB = pop(queue)\n\n                    if eventB is eventA:\n                        entry = eventA[2]\n                        if not entry.canceled:\n                            yield None, entry\n                        continue\n                    else:\n                        push(queue, eventB)\n            else:\n                yield None, None\n\n    def clear(self):\n        self._queue[:] = []  # atomic, without creating a new list.\n\n    def cancel(self, tref):\n        tref.cancel()\n\n    def __len__(self):\n        return len(self._queue)\n\n    def __nonzero__(self):\n        return True\n\n    @property\n    def queue(self, _pop=heapq.heappop):\n        \"\"\"Snapshot of underlying datastructure.\"\"\"\n        events = list(self._queue)\n        return [_pop(v) for v in [events] * len(events)]\n\n    @property\n    def schedule(self):\n        return self\n", "path": "kombu/async/timer.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n\"\"\"Timer scheduling Python callbacks.\"\"\"\nfrom __future__ import absolute_import, unicode_literals\n\nimport heapq\nimport sys\n\nfrom collections import namedtuple\nfrom datetime import datetime\nfrom functools import total_ordering\nfrom weakref import proxy as weakrefproxy\n\nfrom vine.utils import wraps\n\nfrom kombu.five import monotonic, python_2_unicode_compatible\nfrom kombu.log import get_logger\nfrom time import time as _time\n\ntry:\n    from pytz import utc\nexcept ImportError:  # pragma: no cover\n    utc = None\n\n__all__ = ['Entry', 'Timer', 'to_timestamp']\n\nlogger = get_logger(__name__)\n\nDEFAULT_MAX_INTERVAL = 2\nEPOCH = datetime.utcfromtimestamp(0).replace(tzinfo=utc)\nIS_PYPY = hasattr(sys, 'pypy_version_info')\n\nscheduled = namedtuple('scheduled', ('eta', 'priority', 'entry'))\n\n\ndef to_timestamp(d, default_timezone=utc, time=monotonic):\n    \"\"\"Convert datetime to timestamp.\n\n    If d' is already a timestamp, then that will be used.\n    \"\"\"\n    if isinstance(d, datetime):\n        if d.tzinfo is None:\n            d = d.replace(tzinfo=default_timezone)\n        diff = _time() - time()\n        return max((d - EPOCH).total_seconds() - diff, 0)\n    return d\n\n\n@total_ordering\n@python_2_unicode_compatible\nclass Entry(object):\n    \"\"\"Schedule Entry.\"\"\"\n\n    if not IS_PYPY:  # pragma: no cover\n        __slots__ = (\n            'fun', 'args', 'kwargs', 'tref', 'canceled',\n            '_last_run', '__weakref__',\n        )\n\n    def __init__(self, fun, args=None, kwargs=None):\n        self.fun = fun\n        self.args = args or []\n        self.kwargs = kwargs or {}\n        self.tref = weakrefproxy(self)\n        self._last_run = None\n        self.canceled = False\n\n    def __call__(self):\n        return self.fun(*self.args, **self.kwargs)\n\n    def cancel(self):\n        try:\n            self.tref.canceled = True\n        except ReferenceError:  # pragma: no cover\n            pass\n\n    def __repr__(self):\n        return '<TimerEntry: {0}(*{1!r}, **{2!r})'.format(\n            self.fun.__name__, self.args, self.kwargs)\n\n    # must not use hash() to order entries\n    def __lt__(self, other):\n        return id(self) < id(other)\n\n    @property\n    def cancelled(self):\n        return self.canceled\n\n    @cancelled.setter\n    def cancelled(self, value):\n        self.canceled = value\n\n\nclass Timer(object):\n    \"\"\"Async timer implementation.\"\"\"\n\n    Entry = Entry\n\n    on_error = None\n\n    def __init__(self, max_interval=None, on_error=None, **kwargs):\n        self.max_interval = float(max_interval or DEFAULT_MAX_INTERVAL)\n        self.on_error = on_error or self.on_error\n        self._queue = []\n\n    def __enter__(self):\n        return self\n\n    def __exit__(self, *exc_info):\n        self.stop()\n\n    def call_at(self, eta, fun, args=(), kwargs={}, priority=0):\n        return self.enter_at(self.Entry(fun, args, kwargs), eta, priority)\n\n    def call_after(self, secs, fun, args=(), kwargs={}, priority=0):\n        return self.enter_after(secs, self.Entry(fun, args, kwargs), priority)\n\n    def call_repeatedly(self, secs, fun, args=(), kwargs={}, priority=0):\n        tref = self.Entry(fun, args, kwargs)\n\n        @wraps(fun)\n        def _reschedules(*args, **kwargs):\n            last, now = tref._last_run, monotonic()\n            lsince = (now - tref._last_run) if last else secs\n            try:\n                if lsince and lsince >= secs:\n                    tref._last_run = now\n                    return fun(*args, **kwargs)\n            finally:\n                if not tref.canceled:\n                    last = tref._last_run\n                    next = secs - (now - last) if last else secs\n                    self.enter_after(next, tref, priority)\n\n        tref.fun = _reschedules\n        tref._last_run = None\n        return self.enter_after(secs, tref, priority)\n\n    def enter_at(self, entry, eta=None, priority=0, time=monotonic):\n        \"\"\"Enter function into the scheduler.\n\n        Arguments:\n            entry (~kombu.async.timer.Entry): Item to enter.\n            eta (datetime.datetime): Scheduled time.\n            priority (int): Unused.\n        \"\"\"\n        if eta is None:\n            eta = time()\n        if isinstance(eta, datetime):\n            try:\n                eta = to_timestamp(eta)\n            except Exception as exc:\n                if not self.handle_error(exc):\n                    raise\n                return\n        return self._enter(eta, priority, entry)\n\n    def enter_after(self, secs, entry, priority=0, time=monotonic):\n        return self.enter_at(entry, time() + secs, priority)\n\n    def _enter(self, eta, priority, entry, push=heapq.heappush):\n        push(self._queue, scheduled(eta, priority, entry))\n        return entry\n\n    def apply_entry(self, entry):\n        try:\n            entry()\n        except Exception as exc:\n            if not self.handle_error(exc):\n                logger.error('Error in timer: %r', exc, exc_info=True)\n\n    def handle_error(self, exc_info):\n        if self.on_error:\n            self.on_error(exc_info)\n            return True\n\n    def stop(self):\n        pass\n\n    def __iter__(self, min=min, nowfun=monotonic,\n                 pop=heapq.heappop, push=heapq.heappush):\n        \"\"\"Iterate over schedule.\n\n        This iterator yields a tuple of ``(wait_seconds, entry)``,\n        where if entry is :const:`None` the caller should wait\n        for ``wait_seconds`` until it polls the schedule again.\n        \"\"\"\n        max_interval = self.max_interval\n        queue = self._queue\n\n        while 1:\n            if queue:\n                eventA = queue[0]\n                now, eta = nowfun(), eventA[0]\n\n                if now < eta:\n                    yield min(eta - now, max_interval), None\n                else:\n                    eventB = pop(queue)\n\n                    if eventB is eventA:\n                        entry = eventA[2]\n                        if not entry.canceled:\n                            yield None, entry\n                        continue\n                    else:\n                        push(queue, eventB)\n            else:\n                yield None, None\n\n    def clear(self):\n        self._queue[:] = []  # atomic, without creating a new list.\n\n    def cancel(self, tref):\n        tref.cancel()\n\n    def __len__(self):\n        return len(self._queue)\n\n    def __nonzero__(self):\n        return True\n\n    @property\n    def queue(self, _pop=heapq.heappop):\n        \"\"\"Snapshot of underlying datastructure.\"\"\"\n        events = list(self._queue)\n        return [_pop(v) for v in [events] * len(events)]\n\n    @property\n    def schedule(self):\n        return self\n", "path": "kombu/async/timer.py"}]}