code: def test_wait_timeout(mock_get: Mock):
      """Test waits until timeout error is raised."""
      endpoint = InferenceEndpoint.from_raw(
          MOCK_INITIALIZING, namespace="foo"
      )
  
      mock_get.side_effect = [
          InferenceEndpoint.from_raw(
              MOCK_INITIALIZING, namespace="foo"
          ),
          InferenceEndpoint.from_raw(
              MOCK_INITIALIZING, namespace="foo"
          ),
          InferenceEndpoint.from_raw(
              MOCK_INITIALIZING, namespace="foo"
          ),
          InferenceEndpoint.from_raw(
              MOCK_INITIALIZING, namespace="foo"
          ),
      ]
      with pytest.raises(InferenceEndpointTimeoutError):
          endpoint.wait(timeout=0.1, refresh_every=0.05)
  
      assert endpoint.status == "pending"
      assert len(mock_get.call_args_list) == 3
  
file_path: huggingface_hub/tests/test_inference_endpoints.py
imports: from datetime import datetime, timezone
  from unittest.mock import Mock, patch
  import pytest
  from huggingface_hub import AsyncInferenceClient, HfApi, InferenceClient, InferenceEndpoint, InferenceEndpointError, InferenceEndpointTimeoutError
label_desc: Use image node_id 7 for calling a global function with example usage: test_wait_timeout(mock_get) without return types