





import pytest
import requests

from datasets.utils.file_utils import http_head

from .utils import OfflineSimulationMode, RequestWouldHangIndefinitelyError, offline



@pytest.mark.integration
def _a				(	)	->						List[str]:







      '''simple docstring'''






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







      '''simple docstring'''






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







def _a				(	)	->						List[str]:







      '''simple docstring'''






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








'''simple docstring'''






lowerCAmelCase__											=	'''Input must be a string of 8 numbers plus letter'''
lowerCAmelCase__											=	'''TRWAGMYFPDXBNJZSQVHLCKE'''


def 		_A     (    A__      ):






 """simple docstring"""



 if not isinstance(A__     ,				A__      ):
  __lowercase							  = F"Expected string as input, found {type(A__      ).__name__}"
  raise TypeError(A__      )

 __lowercase							  = spanish_id.replace('''-'''     ,				''''''      ).upper()
 if len(A__      ) != 9:
  raise ValueError(A__      )

 try:
  __lowercase							  = int(spanish_id_clean[0:8]      )
  __lowercase							  = spanish_id_clean[8]
 except ValueError as ex:
  raise ValueError(A__      ) from ex

 if letter.isdigit():
  raise ValueError(A__      )

 return letter == LOOKUP_LETTERS[number % 23]


if __name__ == "__main__":
 import doctest

 doctest.testmod()

