code: def test_head_node_resource(ray_start_cluster):
      """Test that the special head node resource is set."""
      cluster = ray_start_cluster
      # head node
      cluster.add_node(num_cpus=1)
      ray.init(address=cluster.address)
  
      assert ray.cluster_resources()[HEAD_NODE_RESOURCE_NAME] == 1
  
      # worker node
      cluster.add_node(num_cpus=1)
  
      assert ray.cluster_resources()[HEAD_NODE_RESOURCE_NAME] == 1
  
imports: import gc
  import logging
  import os
  import sys
  import time
  import subprocess
  from unittest.mock import Mock, patch
  import unittest
  import pytest
  import ray
  import ray.cluster_utils
  from ray._private.test_utils import run_string_as_driver, wait_for_pid_to_exit, client_test_enabled
  from ray._private.resource_spec import HEAD_NODE_RESOURCE_NAME
label_desc: Use image node_id 10 for calling a global function with example usage: test_head_node_resource(ray_start_cluster) without return types