'''simple docstring'''






import operator





def  _SCREAMING_SNAKE_CASE		(      __snake_case							:			list   ,		__snake_case							:			bool = False   ,		__snake_case							:			list | None = None				):
     _A    		=  operator.lt if reverse else operator.gt
     _A    		=  solution or []

     if not arr:
          return solution

     _A    		=  [arr.pop(0				)]
     for i, item in enumerate(__snake_case				):
          if _operator(__snake_case   ,		sublist[-1]				):
               sublist.append(__snake_case				)
               arr.pop(__snake_case				)

    #  merging sublist into solution list
     if not solution:
          solution.extend(__snake_case				)
     else:
          while sublist:
               _A    		=  sublist.pop(0				)
               for i, xx in enumerate(__snake_case				):
                    if not _operator(__snake_case   ,		__snake_case				):
                         solution.insert(__snake_case   ,		__snake_case				)
                         break
               else:
                    solution.append(__snake_case				)

     strand_sort(__snake_case   ,		__snake_case   ,		__snake_case				)
     return solution


if __name__ == "__main__":
   assert strand_sort([4, 3, 5, 1, 2]) == [1, 2, 3, 4, 5]
   assert strand_sort([4, 3, 5, 1, 2], reverse=True) == [5, 4, 3, 2, 1]




'''simple docstring'''






import pytest
import requests

from datasets.utils.file_utils import http_head

from .utils import OfflineSimulationMode, RequestWouldHangIndefinitelyError, offline





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





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



