



import pytest
import requests

from datasets.utils.file_utils import http_head

from .utils import OfflineSimulationMode, RequestWouldHangIndefinitelyError, offline







@pytest.mark.integration
def    _snake_case (       )     ->     Union[str, Any]:






      '''simple docstring'''







      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    _snake_case (       )     ->     List[str]:






      '''simple docstring'''







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







def    _snake_case (       )     ->     Dict:






      '''simple docstring'''







      with offline(OfflineSimulationMode.HF_DATASETS_OFFLINE_SET_TO_1    ):
            with pytest.raises(_lowerCamelCase    ):
                  http_head("https://huggingface.co"    )





def    _snake_case (       __snake_case					,  __snake_case					,  __snake_case    )     ->     list:






      '''simple docstring'''







      UpperCAmelCase_  :	Any				      =		len(__snake_case    )
      UpperCAmelCase_  :	Tuple				      =		[[0] * n for i in range(__snake_case    )]
      for i in range(__snake_case    ):
            UpperCAmelCase_  :	Optional[Any]				      =		y_points[i]

      for i in range(2					,  __snake_case    ):
            for j in range(__snake_case					,  __snake_case    ):
                  UpperCAmelCase_  :	int				      =		(
                      (xa - x_points[j - i + 1]) * q[j][i - 1]
                      - (xa - x_points[j]) * q[j - 1][i - 1]
                  ) / (x_points[j] - x_points[j - i + 1])

      return [q[n - 1][n - 1], q]


if __name__ == "__main__":
   import doctest

   doctest.testmod()
