code: def test_cloudwatch_dashboard_update_head_node(
      ec2_client_stub, ssm_client_stub, cloudwatch_client_stub
  ):
      # create test cluster head node ID and an associated cloudwatch helper
      node_id = "i-abc"
      is_head_node = True
      cloudwatch_helper = helpers.get_cloudwatch_helper(node_id)
  
      # given a directive to check for the Unified CloudWatch Agent status...
      # expect CloudWatch Agent is installed
      stubs.get_ec2_cwa_installed_tag_true(ec2_client_stub, node_id)
  
      # given a directive to update a cluster CloudWatch Dashboard Config
      # with new changes...
      # expect the stored the CloudWatch Dashboard Config is different from local
      # config
      cw_ssm_param_name = helpers.get_ssm_param_name(
          cloudwatch_helper.cluster_name, "dashboard"
      )
      stubs.get_param_ssm_different(ssm_client_stub, cw_ssm_param_name)
  
      # given an updated CloudWatch Dashboard Config file...
      # expect to store the new CloudWatch Dashboard config as an SSM parameter
      stubs.put_parameter_cloudwatch_config(
          ssm_client_stub, cloudwatch_helper.cluster_name, "dashboard"
      )
  
      # given an updated CloudWatch Dashboard Config file...
      # expect to update the node tag equal to updated config file sha1 hash
      # to reflect the changes in config file
      stubs.update_hash_tag_success(
          ec2_client_stub, node_id, "dashboard", cloudwatch_helper
      )
  
      # given a directive to create a cluster CloudWatch dashboard...
      # expect to make a call to create a dashboard for each node in the cluster
      stubs.put_cluster_dashboard_success(
          cloudwatch_client_stub,
          cloudwatch_helper,
      )
      # given our mocks and the example CloudWatch Dashboard config as input...
      # expect CloudWatch Dashboard configured to use updated file
      # on each cluster node successfully
      cloudwatch_helper._update_cloudwatch_config(
          "dashboard", is_head_node
      )
  
      # expect no pending responses left in client stub queues
      ec2_client_stub.assert_no_pending_responses()
      ssm_client_stub.assert_no_pending_responses()
  
imports: import copy
  from unittest.mock import Mock, patch
  import pytest
  from click.exceptions import ClickException
  import ray.tests.aws.utils.helpers
  import ray.tests.aws.utils.stubs
  from ray.autoscaler._private.aws.config import DEFAULT_AMI, _configure_subnet, _get_subnets_or_die, bootstrap_aws, log_to_cli
  from ray.autoscaler._private.aws.node_provider import AWSNodeProvider
  from ray.autoscaler._private.providers import _get_node_provider
  from ray.tests.aws.utils.constants import AUX_SG, AUX_SUBNET, CUSTOM_IN_BOUND_RULES, DEFAULT_CLUSTER_NAME, DEFAULT_INSTANCE_PROFILE, DEFAULT_KEY_PAIR, DEFAULT_LT, DEFAULT_SG, DEFAULT_SG_AUX_SUBNET, DEFAULT_SG_DUAL_GROUP_RULES, DEFAULT_SG_WITH_NAME, DEFAULT_SG_WITH_NAME_AND_RULES, DEFAULT_SG_WITH_RULES, DEFAULT_SG_WITH_RULES_AUX_SUBNET, DEFAULT_SUBNET
label_desc: Use image node_id 22 for calling a global function with example usage: test_cloudwatch_dashboard_update_head_node(ec2_client_stub, ssm_client_stub, cloudwatch_client_stub) without return types