






import pytest
import requests

from datasets.utils.file_utils import http_head

from .utils import OfflineSimulationMode, RequestWouldHangIndefinitelyError, offline





@pytest.mark.integration
def  _a(  ):




      '''simple docstring'''






      with offline(OfflineSimulationMode.CONNECTION_TIMES_OUT							):
            with pytest.raises(SCREAMING_SNAKE_CASE_							):
                  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  _a(  ):




      '''simple docstring'''






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







def  _a(  ):




      '''simple docstring'''






      with offline(OfflineSimulationMode.HF_DATASETS_OFFLINE_SET_TO_1							):
            with pytest.raises(SCREAMING_SNAKE_CASE_							):
                  http_head('''https://huggingface.co'''							)







'''simple docstring'''
from math import isqrt





def  _a(  UpperCamelCase__				:						int							):




      '''simple docstring'''






      SCREAMING_SNAKE_CASE__     :				int									=[True] * max_number
      for i in range(2,	isqrt(max_number - 1							) + 1							):
            if is_prime[i]:
                  for j in range(i**2,	UpperCamelCase__,	UpperCamelCase__							):
                        SCREAMING_SNAKE_CASE__     :				Any									=False

      return [i for i in range(2,	UpperCamelCase__							) if is_prime[i]]





def  _a(  UpperCamelCase__				:						int = 1_0**8							):




      '''simple docstring'''






      SCREAMING_SNAKE_CASE__     :				Tuple									=calculate_prime_numbers(max_number // 2							)

      SCREAMING_SNAKE_CASE__     :				int									=0
      SCREAMING_SNAKE_CASE__     :				int									=0
      SCREAMING_SNAKE_CASE__     :				Optional[int]									=len(UpperCamelCase__							) - 1
      while left <= right:
            while prime_numbers[left] * prime_numbers[right] >= max_number:
                  right -= 1
            semiprimes_count += right - left + 1
            left += 1

      return semiprimes_count


if __name__ == "__main__":
  print(F'''{solution() = }''')