def next_method(it):
    """
    Get the method that yields next value from the given
    sync or async iterable. Returns (method, is_sync) tuple of
    the method and a boolean of whether the iterable is synchronous or not.
    """
    if hasattr(it, '__next__'):
        nxt = it.__next__
        is_sync = True
    elif hasattr(it, '__iter__'):
        nxt = it.__iter__().__next__
        is_sync = True
    elif hasattr(it, '__anext__'):
        nxt = it.__anext__
        is_sync = False
    elif hasattr(it, '__aiter__'):
        nxt = it.__aiter__().__anext__
        is_sync = False
    else:
        raise ValueError(f'{it} is not iterable')
    return nxt, is_sync