# Path: external/asyncio/tasks.py
# def coroutine(func):
#     """Decorator to mark coroutines.
# 
#     If the coroutine is not yielded from before it is destroyed,
#     an error message is logged.
#     """
#     if inspect.isgeneratorfunction(func):
#         coro = func
#     else:
#         @functools.wraps(func)
#         def coro(*args, **kw):
#             res = func(*args, **kw)
#             if isinstance(res, futures.Future) or inspect.isgenerator(res):
#                 res = yield from res
#             return res
# 
#     if not _DEBUG:
#         wrapper = coro
#     else:
#         @functools.wraps(func)
#         def wrapper(*args, **kwds):
#             w = CoroWrapper(coro(*args, **kwds), func)
#             w.__name__ = func.__name__
#             if _PY35:
#                 w.__qualname__ = func.__qualname__
#             w.__doc__ = func.__doc__
#             return w
# 
#     wrapper._is_coroutine = True  # For iscoroutinefunction().
#     return wrapper


import collections
import heapq
from . import events
from . import futures
from . import locks
from .tasks import coroutine
        result = Queue._format(self)
        if self._unfinished_tasks:
            result += ' tasks={}'.format(self._unfinished_tasks)
        return result

    def _put(self, item):
        super()._put(item)
        self._unfinished_tasks += 1
        self._finished.clear()

    def task_done(self):
        """Indicate that a formerly enqueued task is complete.

        Used by queue consumers. For each get() used to fetch a task,
        a subsequent call to task_done() tells the queue that the processing
        on the task is complete.

        If a join() is currently blocking, it will resume when all items have
        been processed (meaning that a task_done() call was received for every
        item that had been put() into the queue).

        Raises ValueError if called more times than there were items placed in
        the queue.
        """
        if self._unfinished_tasks <= 0:
            raise ValueError('task_done() called too many times')
        self._unfinished_tasks -= 1
        if self._unfinished_tasks == 0:
            self._finished.set()


# Path: external/asyncio/tasks.py
# def coroutine(func):
#     """Decorator to mark coroutines.
# 
#     If the coroutine is not yielded from before it is destroyed,
#     an error message is logged.
#     """
#     if inspect.isgeneratorfunction(func):
#         coro = func
#     else:
#         @functools.wraps(func)
#         def coro(*args, **kw):
#             res = func(*args, **kw)
#             if isinstance(res, futures.Future) or inspect.isgenerator(res):
#                 res = yield from res
#             return res
# 
#     if not _DEBUG:
#         wrapper = coro
#     else:
#         @functools.wraps(func)
#         def wrapper(*args, **kwds):
#             w = CoroWrapper(coro(*args, **kwds), func)
#             w.__name__ = func.__name__
#             if _PY35:
#                 w.__qualname__ = func.__qualname__
#             w.__doc__ = func.__doc__
#             return w
# 
#     wrapper._is_coroutine = True  # For iscoroutinefunction().
#     return wrapper


# Path: external/asyncio/queues.py
import collections
import heapq
from . import events
from . import futures
from . import locks
from .tasks import coroutine

        result = Queue._format(self)
        if self._unfinished_tasks:
            result += ' tasks={}'.format(self._unfinished_tasks)
        return result

    def _put(self, item):
        super()._put(item)
        self._unfinished_tasks += 1
        self._finished.clear()

    def task_done(self):
        """Indicate that a formerly enqueued task is complete.

        Used by queue consumers. For each get() used to fetch a task,
        a subsequent call to task_done() tells the queue that the processing
        on the task is complete.

        If a join() is currently blocking, it will resume when all items have
        been processed (meaning that a task_done() call was received for every
        item that had been put() into the queue).

        Raises ValueError if called more times than there were items placed in
        the queue.
        """
        if self._unfinished_tasks <= 0:
            raise ValueError('task_done() called too many times')
        self._unfinished_tasks -= 1
        if self._unfinished_tasks == 0:
            self._finished.set()


    @coroutine