



import pytest
import requests

from datasets.utils.file_utils import http_head

from .utils import OfflineSimulationMode, RequestWouldHangIndefinitelyError, offline






@pytest.mark.integration
def 			lowerCAmelCase__	(					):





				'''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 			lowerCAmelCase__	(					):





				'''simple docstring'''

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






def 			lowerCAmelCase__	(					):





				'''simple docstring'''

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






def 			lowerCAmelCase__	(					lowerCamelCase_	:	int):





				'''simple docstring'''

				if not isinstance(lowerCamelCase_ ,lowerCamelCase_):
								lowerCAmelCase__  :       Dict				=  f"""Input value of [number={number}] must be an integer"""
								raise TypeError(lowerCamelCase_)

				if number < 1:
								lowerCAmelCase__  :       Any				=  f"""Input value of [number={number}] must be > 0"""
								raise ValueError(lowerCamelCase_)

				lowerCAmelCase__  :       List[str]				=  1

				for i in range(1 ,lowerCamelCase_):
								current_number *= 4 * i - 2
								current_number //= i + 1

				return current_number


if __name__ == "__main__":
							import doctest

							doctest.testmod()

