






import pytest
import requests

from datasets.utils.file_utils import http_head

from .utils import OfflineSimulationMode, RequestWouldHangIndefinitelyError, offline






@pytest.mark.integration
def      _snake_case     ():
   with offline(OfflineSimulationMode.CONNECTION_TIMES_OUT):
      with pytest.raises(__lowercase):
         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      _snake_case     ():
   with offline(OfflineSimulationMode.CONNECTION_FAILS):
      with pytest.raises(requests.exceptions.ConnectionError):
         requests.request('GET'     ,   'https://huggingface.co')






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






"""simple docstring"""



from __future__ import annotations

def  _A(		lowerCAmelCase							):
							if len(lowerCAmelCase							) == 0:
														return []
							A__				,							A__       :     Dict								=			min(lowerCAmelCase							), max(lowerCAmelCase							)
							A__       :     List[Any]								=			int(max_value - min_value							) + 1
							A__       :     list[list]								=			[[] for _ in range(lowerCAmelCase							)]

							for i in my_list:
														buckets[int(i - min_value							)].append(lowerCAmelCase							)

							return [v for bucket in buckets for v in sorted(lowerCAmelCase							)]


if __name__ == "__main__":
				from doctest import testmod

				testmod()
				assert bucket_sort([4, 5, 3, 2, 1]) == [1, 2, 3, 4, 5]
				assert bucket_sort([0, 1, -10, 15, 2, -2]) == [-10, -2, 0, 1, 2, 15]





