def isgenerator(x):
    """
    Returns `True` if the given value is sync or async generator coroutine.

    Arguments:
        x (mixed): value to check if it is an iterable.

    Returns:
        bool
    """
    return any([
        hasattr(x, '__next__'),
        hasattr(x, '__anext__')
    ])