


import pytest
import requests

from datasets.utils.file_utils import http_head

from .utils import OfflineSimulationMode, RequestWouldHangIndefinitelyError, offline


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


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


"""simple docstring"""
import warnings

from ..trainer import Trainer
from ..utils import logging


SCREAMING_SNAKE_CASE_					     =	logging.get_logger(__name__)
class       lowerCAmelCase_		(				A__ ):



							'''simple docstring'''





							def __init__( self    ,				snake_case_=None    ,				**snake_case_				)       ->  Optional[Any]:
													warnings.warn(
													    """`SageMakerTrainer` is deprecated and will be removed in v5 of Transformers. You can use `Trainer` """
													    """instead."""    ,				snake_case_    ,				)
													super().__init__(args=snake_case_    ,				**snake_case_				)
