





import pytest
import requests

from datasets.utils.file_utils import http_head

from .utils import OfflineSimulationMode, RequestWouldHangIndefinitelyError, offline



@pytest.mark.integration
def A_     (		)  ->		List[Any]:





       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 A_     (		)  ->		Optional[Any]:





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



def A_     (		)  ->		List[Any]:





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









import enum
import shutil
import sys


lowercase						, lowercase				:	List[Any]      						=  shutil.get_terminal_size()

lowercase				:	Union[str, Any]      						=  {"""UP""": """A""", """DOWN""": """B""", """RIGHT""": """C""", """LEFT""": """D"""}





class 			A__   (							enum.Enum     ):




   """simple docstring"""



   __A       :    List[str]	  =  0
   __A       :    str	  =  1



def A_     (		A__		,				A__=""    )  ->		int:
       sys.stdout.write(str(A__    ) + end    )
       sys.stdout.flush()



def A_     (		A__		,				A__		,				A__=""    )  ->		int:
       forceWrite(F'\u001b[{color}m{content}\u001b[0m'		,				A__    )



def A_     (		)  ->		Any:
       forceWrite('\r'    )



def A_     (		A__		,				A__    )  ->		List[str]:
       forceWrite(F'\033[{num_lines}{CURSOR_TO_CHAR[direction.upper()]}'    )



def A_     (		)  ->		Any:
       forceWrite(' ' * TERMINAL_WIDTH    )
       reset_cursor()



def A_     (		)  ->		Any:
       reset_cursor()
       forceWrite('-' * TERMINAL_WIDTH    )


