code: def test_network_interfaces(
      ec2_client_stub,
      iam_client_stub,
      ec2_client_stub_fail_fast,
      ec2_client_stub_max_retries,
  ):
      # use default stubs to skip ahead to subnet configuration
      stubs.configure_iam_role_default(iam_client_stub)
      stubs.configure_key_pair_default(ec2_client_stub)
  
      # given the security groups associated with our network interfaces...
      sgids = [
          "sg-00000000",
          "sg-11111111",
          "sg-22222222",
          "sg-33333333",
      ]
      security_groups = []
      suffix = 0
      for sgid in sgids:
          sg = copy.deepcopy(DEFAULT_SG)
          sg["GroupName"] += f"-{suffix}"
          sg["GroupId"] = sgid
          security_groups.append(sg)
          suffix += 1
      # expect to describe all security groups to ensure they share the same VPC
      stubs.describe_sgs_by_id(ec2_client_stub, sgids, security_groups)
  
      # use a default stub to skip subnet configuration
      stubs.configure_subnet_default(ec2_client_stub)
      stubs.describe_subnets_echo(
          ec2_client_stub,
          [
              DEFAULT_SUBNET,
              {**DEFAULT_SUBNET, "SubnetId": "subnet-11111111"},
          ],
      )
      stubs.describe_subnets_echo(
          ec2_client_stub,
          [{**DEFAULT_SUBNET, "SubnetId": "subnet-22222222"}],
      )
      stubs.describe_subnets_echo(
          ec2_client_stub,
          [{**DEFAULT_SUBNET, "SubnetId": "subnet-33333333"}],
      )
  
      # given our mocks and an example config file as input...
      # expect the config to be loaded, validated, and bootstrapped successfully
      config = helpers.bootstrap_aws_example_config_file(
          "example-network-interfaces.yaml"
      )
  
      # instantiate a new node provider
      new_provider = _get_node_provider(
          config["provider"],
          DEFAULT_CLUSTER_NAME,
          False,
      )
  
      for name, node_type in config["available_node_types"].items():
          node_cfg = node_type["node_config"]
          tags = helpers.node_provider_tags(config, name)
          # given our bootstrapped node config as input to create a new node...
          # expect to first describe all stopped instances that could be reused
          stubs.describe_instances_with_any_filter_consumer(
              ec2_client_stub_max_retries
          )
          # given no stopped EC2 instances to reuse...
          # expect to create new nodes with the given network interface config
          stubs.run_instances_with_network_interfaces_consumer(
              ec2_client_stub_fail_fast,
              node_cfg["NetworkInterfaces"],
          )
          new_provider.create_node(node_cfg, tags, 1)
  
      iam_client_stub.assert_no_pending_responses()
      ec2_client_stub.assert_no_pending_responses()
      ec2_client_stub_fail_fast.assert_no_pending_responses()
      ec2_client_stub_max_retries.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 10 for calling a global function with example usage: test_network_interfaces(ec2_client_stub, iam_client_stub, ec2_client_stub_fail_fast, ec2_client_stub_max_retries) without return types