code: def _run_instance(
      api_client: LambdaAPIClient,
      region: str,
      instance_type_name: str,
      user_ssh_public_key: str,
      project_ssh_public_key: str,
      project_ssh_private_key: str,
      instance_name: str,
      launch_command: str,
  ) -> LaunchedInstanceInfo:
      _, project_key_name = _add_ssh_keys(
          api_client=api_client,
          user_ssh_public_key=user_ssh_public_key,
          project_ssh_public_key=project_ssh_public_key,
      )
      instances_ids = api_client.launch_instances(
          region_name=region,
          instance_type_name=instance_type_name,
          ssh_key_names=[project_key_name],
          name=instance_name,
          quantity=1,
          file_system_names=[],
      )
      instance_id = instances_ids[0]
      instance_info = _wait_for_instance(api_client, instance_id)
      thread = Thread(
          target=_start_runner,
          kwargs={
              "hostname": instance_info["ip"],
              "project_ssh_private_key": project_ssh_private_key,
              "user_ssh_public_key": user_ssh_public_key,
              "config": _ShimConfig(
                  instance_id=instance_id, api_key=api_client.api_key
              ),
              "launch_command": launch_command,
          },
          daemon=True,
      )
      thread.start()
      return LaunchedInstanceInfo(
          instance_id=instance_id,
          ip_address=instance_info["ip"],
          region=region,
          username="ubuntu",
          ssh_port=22,
          dockerized=True,
          backend_data=None,
      )
  
imports: import hashlib
  import subprocess
  import tempfile
  import time
  from threading import Thread
  from typing import Dict, List, Optional, Tuple
  from pydantic import BaseModel
  from dstack._internal.core.backends.base.compute import Compute, get_instance_name, get_shim_commands
  from dstack._internal.core.backends.base.offers import get_catalog_offers
  from dstack._internal.core.backends.lambdalabs.api_client import LambdaAPIClient
  from dstack._internal.core.backends.lambdalabs.config import LambdaConfig
  from dstack._internal.core.models.backends.base import BackendType
  from dstack._internal.core.models.instances import InstanceAvailability, InstanceOffer, InstanceOfferWithAvailability, LaunchedInstanceInfo
  from dstack._internal.core.models.runs import Job, Requirements, Run
label_desc: Use image node_id 1 for calling a global function with example usage: _run_instance(api_client, region, instance_type_name, user_ssh_public_key, project_ssh_public_key, project_ssh_private_key, instance_name, launch_command) and returns: LaunchedInstanceInfo