


import pytest
import requests

from datasets.utils.file_utils import http_head

from .utils import OfflineSimulationMode, RequestWouldHangIndefinitelyError, offline

@pytest.mark.integration
def   _UpperCAmelCase       (     ):
      """simple docstring"""




      with offline(OfflineSimulationMode.CONNECTION_TIMES_OUT      ):
            with pytest.raises(UpperCAmelCase      ):
                  requests.request("""GET"""						,	"""https://huggingface.co"""      )
            with pytest.raises(requests.exceptions.ConnectTimeout      ):
                  requests.request("""GET"""						,	"""https://huggingface.co"""						,	timeout=1.0      )

@pytest.mark.integration
def   _UpperCAmelCase       (     ):
      """simple docstring"""




      with offline(OfflineSimulationMode.CONNECTION_FAILS      ):
            with pytest.raises(requests.exceptions.ConnectionError      ):
                  requests.request("""GET"""						,	"""https://huggingface.co"""      )




def   _UpperCAmelCase       (     ):
      """simple docstring"""




      with offline(OfflineSimulationMode.HF_DATASETS_OFFLINE_SET_TO_1      ):
            with pytest.raises(UpperCAmelCase      ):
                  http_head("""https://huggingface.co"""      )







def   _UpperCAmelCase       (     ):
      """simple docstring"""




      __lowerCamelCase     :      Optional[int]       						=						[31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]

      __lowerCamelCase     :      str       						=						6
      __lowerCamelCase     :      Optional[int]       						=						1
      __lowerCamelCase     :      Optional[int]       						=						1_901

      __lowerCamelCase     :      Optional[Any]       						=						0

      while year < 2_001:
            day += 7

            if (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0):
                  if day > days_per_month[month - 1] and month != 2:
                        month += 1
                        __lowerCamelCase     :      Tuple       						=						day - days_per_month[month - 2]
                  elif day > 29 and month == 2:
                        month += 1
                        __lowerCamelCase     :      str       						=						day - 29
            else:
                  if day > days_per_month[month - 1]:
                        month += 1
                        __lowerCamelCase     :      Any       						=						day - days_per_month[month - 2]

            if month > 12:
                  year += 1
                  __lowerCamelCase     :      Optional[Any]       						=						1

            if year < 2_001 and day == 1:
                  sundays += 1
      return sundays


if __name__ == "__main__":
    print(solution())



