def METHOD_NAME(data, page_size=10000):
    # TODO add support for Pandas
    try:
        while True:
            page = data.fetchmany(page_size)
            if not page:
                return
            yield page
    except AttributeError:
        it = iter(data)
        while True:
            page = list(itertools.islice(it, page_size))
            if not page:
                return
            yield page