# Path: twitch/constants.py
# BASE_HELIX_URL = "https://api.twitch.tv/helix/"
# 
# Path: twitch/exceptions.py
# class TwitchNotProvidedException(TwitchException):
#     pass


import logging
import time
import requests
from requests import codes
from requests.compat import urljoin
from twitch.constants import BASE_HELIX_URL
from twitch.exceptions import TwitchNotProvidedException
    # Python 2 compatibility.
    next = __next__

    def __getitem__(self, index):
        return self._queue[index]

    def next_page(self):
        # Twitch stops returning a cursor when you're on the last page. So if we've made
        # more than 1 request to their API and we don't get a cursor back, it means
        # we're on the last page, so return whatever's left in the queue.
        if self._requests_count > 0 and not self._cursor:
            return self._queue

        if self._cursor:
            self._params["after"] = self._cursor

        response = self._request_get(self._path, params=self._params)
        self._requests_count += 1
        self._queue = [self._resource.construct_from(data) for data in response["data"]]
        self._cursor = response["pagination"].get("cursor")
        self._total = response.get("total")
        return self._queue

    @property
    def cursor(self):
        return self._cursor

    @property
    def total(self):
        if not self._total:

# Path: twitch/constants.py
# BASE_HELIX_URL = "https://api.twitch.tv/helix/"
# 
# Path: twitch/exceptions.py
# class TwitchNotProvidedException(TwitchException):
#     pass


# Path: twitch/helix/base.py
import logging
import time
import requests
from requests import codes
from requests.compat import urljoin
from twitch.constants import BASE_HELIX_URL
from twitch.exceptions import TwitchNotProvidedException

    # Python 2 compatibility.
    next = __next__

    def __getitem__(self, index):
        return self._queue[index]

    def next_page(self):
        # Twitch stops returning a cursor when you're on the last page. So if we've made
        # more than 1 request to their API and we don't get a cursor back, it means
        # we're on the last page, so return whatever's left in the queue.
        if self._requests_count > 0 and not self._cursor:
            return self._queue

        if self._cursor:
            self._params["after"] = self._cursor

        response = self._request_get(self._path, params=self._params)
        self._requests_count += 1
        self._queue = [self._resource.construct_from(data) for data in response["data"]]
        self._cursor = response["pagination"].get("cursor")
        self._total = response.get("total")
        return self._queue

    @property
    def cursor(self):
        return self._cursor

    @property
    def total(self):
        if not self._total:

            raise TwitchNotProvidedException()