code: def test_launch_new_instance_by_type(self):
      instance = create_instance("1")
      success, verison = self.instance_storage.upsert_instance(instance)
      assert success
      instance.version = verison
      assert 1 == self.instance_launcher._launch_new_instances_by_type(
          "worker_nodes1", [instance]
      )
      instances, _ = self.instance_storage.get_instances()
      assert len(instances) == 1
      assert instances["1"].status == Instance.ALLOCATED
      assert instances["1"].cloud_instance_id == "0"
  
imports: import os
  import sys
  import unittest
  import pytest
  from ray._private.test_utils import load_test_config
  from ray.autoscaler._private.event_summarizer import EventSummarizer
  from ray.autoscaler._private.node_launcher import BaseNodeLauncher
  from ray.autoscaler._private.node_provider_availability_tracker import NodeProviderAvailabilityTracker
  from ray.autoscaler.v2.instance_manager.config import AutoscalingConfig
  from ray.autoscaler.v2.instance_manager.instance_storage import InstanceStorage
  from ray.autoscaler.v2.instance_manager.node_provider import NodeProviderAdapter
  from ray.autoscaler.v2.instance_manager.storage import InMemoryStorage
  from ray.autoscaler.v2.instance_manager.subscribers.instance_launcher import InstanceLauncher
  from ray.autoscaler.v2.tests.util import FakeCounter, create_instance
  from ray.core.generated.instance_manager_pb2 import Instance
  from ray.tests.autoscaler_test_utils import MockProvider
label_desc: Use image node_id 2 for calling the InstanceLauncherTest obj's underlying member method code with example usage: obj.test_launch_new_instance_by_type() without return types