


'''simple docstring'''






import math






def 		_A			(lowerCAmelCase__					:int						)				->					bool:




     '''simple docstring'''



     if 1 < number < 4:
          # 2 and 3 are primes
          return True
     elif number < 2 or number % 2 == 0 or number % 3 == 0:
          # Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
          return False

     # All primes number are in format of 6k +/- 1
     for i in range(5			,  int(math.sqrt(lowerCAmelCase__						) + 1						)			,  6						):
          if number % i == 0 or number % (i + 2) == 0:
               return False
     return True






def 		_A			(lowerCAmelCase__					:float = 0.1						)				->					int:




     '''simple docstring'''



     _a      =							3
     _a      =							3

     while primes / (2 * j - 1) >= ratio:
          for i in range(j * j + j + 1			,  (j + 2) * (j + 2)			,  j + 1						):
               primes += is_prime(lowerCAmelCase__						)
          j += 2
     return j


if __name__ == "__main__":
 import doctest

 doctest.testmod()





'''simple docstring'''






import pytest
import requests

from datasets.utils.file_utils import http_head

from .utils import OfflineSimulationMode, RequestWouldHangIndefinitelyError, offline






@pytest.mark.integration
def 		_A			()				->					Optional[Any]:




     '''simple docstring'''



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




     '''simple docstring'''



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






def 		_A			()				->					Dict:




     '''simple docstring'''



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

