# 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
        if self._rate_limit_remaining == 0:
            current_time = int(time.time())
            self._rate_limit_resets = set(
                x for x in self._rate_limit_resets if x > current_time
            )
            if len(self._rate_limit_resets) > 0:
                logger.debug(
                    "Waiting for rate limit reset",
                    extra={
                        "rate_limit_remaining": self._rate_limit_remaining,
                        "rate_limit_resets": self._rate_limit_resets,
                    },
                )

                reset_time = list(self._rate_limit_resets)[0]

                # Calculate wait time and add 0.1s to the wait time to allow Twitch to reset
                # their counter
                wait_time = reset_time - current_time + 0.1
                time.sleep(wait_time)

    def _get_request_headers(self):
        headers = {"Client-ID": self._client_id}

        if self._oauth_token:
            headers["Authorization"] = "Bearer {}".format(self._oauth_token)

        return headers

    def _request_get(self, path, params=None):

# 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

        if self._rate_limit_remaining == 0:
            current_time = int(time.time())
            self._rate_limit_resets = set(
                x for x in self._rate_limit_resets if x > current_time
            )
            if len(self._rate_limit_resets) > 0:
                logger.debug(
                    "Waiting for rate limit reset",
                    extra={
                        "rate_limit_remaining": self._rate_limit_remaining,
                        "rate_limit_resets": self._rate_limit_resets,
                    },
                )

                reset_time = list(self._rate_limit_resets)[0]

                # Calculate wait time and add 0.1s to the wait time to allow Twitch to reset
                # their counter
                wait_time = reset_time - current_time + 0.1
                time.sleep(wait_time)

    def _get_request_headers(self):
        headers = {"Client-ID": self._client_id}

        if self._oauth_token:
            headers["Authorization"] = "Bearer {}".format(self._oauth_token)

        return headers

    def _request_get(self, path, params=None):

        url = urljoin(BASE_HELIX_URL, path)