code: def run_instances_with_launch_template_consumer(
      ec2_client_stub,
      config,
      node_cfg,
      node_type_name,
      lt_data,
      max_count,
  ):
      # create a copy of both node config and launch template data to modify
      lt_data_cp = copy.deepcopy(lt_data)
      node_cfg_cp = copy.deepcopy(node_cfg)
      # override launch template parameters with explicit node config parameters
      lt_data_cp.update(node_cfg_cp)
      # copy all launch template parameters back to node config
      node_cfg_cp.update(lt_data_cp)
      # copy all default node provider config updates to node config
      helpers.apply_node_provider_config_updates(
          config, node_cfg_cp, node_type_name, max_count
      )
      # remove any security group and subnet IDs copied from network interfaces
      node_cfg_cp.pop("SecurityGroupIds", [])
      node_cfg_cp.pop("SubnetIds", [])
      ec2_client_stub.add_response(
          "run_instances",
          expected_params=node_cfg_cp,
          service_response={},
      )
  
imports: from typing import Dict, List
  import ray
  import copy
  import json
  from uuid import uuid4
  from ray.tests.aws.utils import helpers
  from ray.tests.aws.utils.constants import DEFAULT_INSTANCE_PROFILE, DEFAULT_KEY_PAIR, DEFAULT_SUBNET, A_THOUSAND_SUBNETS_IN_DIFFERENT_VPCS, DEFAULT_LT, TWENTY_SUBNETS_IN_DIFFERENT_AZS
  from ray.autoscaler._private.aws.config import key_pair
  from ray.tests.aws.utils.helpers import get_cloudwatch_dashboard_config_file_path, get_cloudwatch_alarm_config_file_path
  from ray.autoscaler._private.aws.cloudwatch.cloudwatch_helper import CLOUDWATCH_AGENT_INSTALLED_TAG, CLOUDWATCH_CONFIG_HASH_TAG_BASE
  from ray.autoscaler.tags import NODE_KIND_HEAD, TAG_RAY_NODE_KIND
  from unittest import mock
  from botocore.stub import ANY
label_desc: Use image node_id 17 for calling a global function with example usage: run_instances_with_launch_template_consumer(ec2_client_stub, config, node_cfg, node_type_name, lt_data, max_count) without return types