code: def test_is_ready_for_shutdown(mock_endpoint_state):
      """Test `is_ready_for_shutdown()` returns the correct state.
  
      Before shutting down endpoint `is_ready_for_shutdown()` should return False.
      After shutting down endpoint `is_ready_for_shutdown()` should return True.
      """
      # Setup endpoint state with checkpoint
      endpoint_state = mock_endpoint_state
      endpoint_state._checkpoint()
  
      # Before shutdown is called, `is_ready_for_shutdown()` should return False
      assert not endpoint_state.is_ready_for_shutdown()
  
      endpoint_state.shutdown()
  
      # After shutdown is called, `is_ready_for_shutdown()` should return True
      assert endpoint_state.is_ready_for_shutdown()
  
file_path: ray/python/ray/serve/tests/unit/test_endpoint_state.py
imports: import sys
  from typing import Any, Tuple
  from unittest.mock import Mock, patch
  import pytest
  from ray.serve._private.endpoint_state import EndpointState
label_desc: Use image node_id 2 for calling a global function with example usage: test_is_ready_for_shutdown(mock_endpoint_state) without return types