# Path: paco/filter.py
# @asyncio.coroutine
# def assert_true(element):
#     """
#     Asserts that a given coroutine yields a true-like value.
# 
#     Arguments:
#         element (mixed): element to evaluate.
# 
#     Returns:
#         bool
#     """
#     return element
# 
# Path: paco/assertions.py
# def assert_corofunction(**kw):
#     """
#     Asserts if a given values are a coroutine function.
# 
#     Arguments:
#         **kw (mixed): value to check if it is an iterable.
# 
#     Raises:
#         TypeError: if assertion fails.
#     """
#     for name, value in kw.items():
#         if not asyncio.iscoroutinefunction(value):
#             raise TypeError(
#                 'paco: {} must be a coroutine function'.format(name))


import asyncio
from .filter import assert_true
from .assertions import assert_corofunction

    Arguments:
        coro (coroutinefunction): coroutine function to execute.
        coro_test (coroutinefunction): coroutine function to test.
        assert_coro (coroutinefunction): optional assertion coroutine used
            to determine if the test passed or not.
        *args (mixed): optional variadic arguments to pass to `coro` function.

    Raises:
        TypeError: if input arguments are invalid.

    Returns:
        list: result values returned by `coro`.

    Usage::

        calls = 0

        async def task():
            nonlocal calls
            calls += 1
            return calls

        async def calls_lt_4():
            return calls > 4

        await paco.until(task, calls_lt_4)
        # => [1, 2, 3, 4, 5]

    """

# Path: paco/filter.py
# @asyncio.coroutine
# def assert_true(element):
#     """
#     Asserts that a given coroutine yields a true-like value.
# 
#     Arguments:
#         element (mixed): element to evaluate.
# 
#     Returns:
#         bool
#     """
#     return element
# 
# Path: paco/assertions.py
# def assert_corofunction(**kw):
#     """
#     Asserts if a given values are a coroutine function.
# 
#     Arguments:
#         **kw (mixed): value to check if it is an iterable.
# 
#     Raises:
#         TypeError: if assertion fails.
#     """
#     for name, value in kw.items():
#         if not asyncio.iscoroutinefunction(value):
#             raise TypeError(
#                 'paco: {} must be a coroutine function'.format(name))


# Path: paco/whilst.py
import asyncio
from .filter import assert_true
from .assertions import assert_corofunction


    Arguments:
        coro (coroutinefunction): coroutine function to execute.
        coro_test (coroutinefunction): coroutine function to test.
        assert_coro (coroutinefunction): optional assertion coroutine used
            to determine if the test passed or not.
        *args (mixed): optional variadic arguments to pass to `coro` function.

    Raises:
        TypeError: if input arguments are invalid.

    Returns:
        list: result values returned by `coro`.

    Usage::

        calls = 0

        async def task():
            nonlocal calls
            calls += 1
            return calls

        async def calls_lt_4():
            return calls > 4

        await paco.until(task, calls_lt_4)
        # => [1, 2, 3, 4, 5]

    """

    assert_corofunction(coro=coro, coro_test=coro_test)