def METHOD_NAME():
    # if the node doesn't exist at all, then the client will raise an exception
    with mock.patch(
        "paasta_tools.kubernetes.bin.paasta_cleanup_stale_nodes.ClientError",
        autospec=True,
    ) as mock_error:
        mock_error.response = {"Error": {"Code": 404}}
        mock_client = mock.MagicMock()
        mock_client.side_effect = mock_error
        assert does_instance_exist(mock_client, "i-12345") is False
    statuses = [
        "pending",
        "running",
        "shutting-down",
        "terminated",
        "stopping",
        "stopped",
    ]
    running = [True, True, False, False, False, False]
    for status, running in zip(statuses, running):
        mock_client.reset_mock()
        mock_client.describe_instance_status.return_value = {
            "InstanceStatuses": [{"InstanceState": {"Name": status}}]
        }
        assert does_instance_exist(mock_client, "i-12345") is running
    # finally, there have been instances where the client doesn't 404, but there
    # isn't a status attached to the instance
    mock_client.reset_mock()
    mock_client.describe_instance_status.return_value = {"InstanceStatuses": []}
    assert does_instance_exist(mock_client, "i-12345") is False