code: def test_terminate_nodes():
      mock_node_config = {"machineType": "n2-standard-8"}
      node_type = GCPNodeType.COMPUTE.value
      id1, id2 = (
          f"instance-id1-{node_type}",
          f"instance-id2-{node_type}",
      )
      terminate_node_ids = [id1, id2]
      mock_resource = MagicMock()
      mock_resource.create_instances.return_value = [
          ({"dict": 1}, id1),
          ({"dict": 2}, id2),
      ]
      mock_resource.delete_instance.return_value = "test"
  
      def __init__(self, provider_config: dict, cluster_name: str):
          self.lock = RLock()
          self.cached_nodes: Dict[str, GCPNode] = {}
          self.resources: Dict[GCPNodeType, GCPResource] = {}
          self.cache_stopped_nodes = False
          self.resources[GCPNodeType.COMPUTE] = mock_resource
  
      with patch.object(GCPNodeProvider, "__init__", __init__):
          node_provider = GCPNodeProvider({}, "")
          node_provider.create_node(mock_node_config, {}, 1)
          node_provider.terminate_nodes(terminate_node_ids)
  
      mock_resource.delete_instance.assert_has_calls(
          [call(node_id=id1), call(node_id=id2)], any_order=True
      )
  
imports: from typing import Dict
  from threading import RLock
  import pytest
  from unittest.mock import MagicMock, patch, call
  import logging
  from ray.autoscaler._private.gcp.node import GCPCompute, GCPNode, GCPNodeType, GCPResource
  from ray.tests.test_autoscaler import MockProcessRunner
  from ray.autoscaler._private.gcp.node_provider import GCPNodeProvider
  from ray.autoscaler._private.gcp.config import get_node_type, _get_num_tpu_chips, _is_single_host_tpu, _has_tpus_in_node_configs, tpu_accelerator_config_to_type
  from ray.autoscaler._private.gcp.tpu_command_runner import TPUCommandRunner, TPUVMSSHCommandRunner, TPUVMDockerCommandRunner
  from ray.autoscaler._private.command_runner import SSHCommandRunner, DockerCommandRunner
label_desc: Use image node_id 2 for calling a global function with example usage: test_terminate_nodes() without return types