code: def launch(
      api: Api,
      job: Optional[str] = None,
      entry_point: Optional[List[str]] = None,
      version: Optional[str] = None,
      name: Optional[str] = None,
      resource: Optional[str] = None,
      resource_args: Optional[Dict[str, Any]] = None,
      project: Optional[str] = None,
      entity: Optional[str] = None,
      docker_image: Optional[str] = None,
      config: Optional[Dict[str, Any]] = None,
      synchronous: Optional[bool] = True,
      run_id: Optional[str] = None,
      repository: Optional[str] = None,
  ) -> AbstractRun:
      """Launch a W&B launch experiment.
  
      Arguments:
          job: string reference to a wandb.Job eg: wandb/test/my-job:latest
          api: An instance of a wandb Api from wandb.apis.internal.
          entry_point: Entry point to run within the project. Defaults to using the entry point used
              in the original run for wandb URIs, or main.py for git repository URIs.
          version: For Git-based projects, either a commit hash or a branch name.
          name: Name run under which to launch the run.
          resource: Execution backend for the run.
          resource_args: Resource related arguments for launching runs onto a remote backend.
              Will be stored on the constructed launch config under ``resource_args``.
          project: Target project to send launched run to
          entity: Target entity to send launched run to
          config: A dictionary containing the configuration for the run. May also contain
          resource specific arguments under the key "resource_args".
          synchronous: Whether to block while waiting for a run to complete. Defaults to True.
              Note that if ``synchronous`` is False and ``backend`` is "local-container", this
              method will return, but the current process will block when exiting until
              the local run completes. If the current process is interrupted, any
              asynchronous runs launched via this method will be terminated. If
              ``synchronous`` is True and the run fails, the current process will
              error out as well.
          run_id: ID for the run (To ultimately replace the :name: field)
          repository: string name of repository path for remote registry
  
      Example:
          ```python
          from wandb.sdk.launch import launch
  
          job = "wandb/jobs/Hello World:latest"
          params = {"epochs": 5}
          # Run W&B project and create a reproducible docker environment
          # on a local host
          api = wandb.apis.internal.Api()
          launch(api, job, parameters=params)
          ```
  
  
      Returns:
          an instance of`wandb.launch.SubmittedRun` exposing information (e.g. run ID)
          about the launched run.
  
      Raises:
          `wandb.exceptions.ExecutionError` If a run launched in blocking mode
          is unsuccessful.
      """
      submitted_run_obj = asyncio.run(
          _launch(
              # TODO: fully deprecate URI path
              uri=None,
              job=job,
              name=name,
              project=project,
              entity=entity,
              docker_image=docker_image,
              entry_point=entry_point,
              version=version,
              resource=resource,
              resource_args=resource_args,
              launch_config=config,
              synchronous=synchronous,
              api=api,
              run_id=run_id,
              repository=repository,
          )
      )
  
      return submitted_run_obj
  
imports: import asyncio
  import logging
  import os
  import sys
  from typing import Any, Dict, List, Optional, Tuple
  import yaml
  import wandb
  from wandb.apis.internal import Api
  from .None import loader
  from ._project_spec import create_project_from_spec, fetch_and_validate_project
  from .agent import LaunchAgent
  from .builder.build import construct_agent_configs
  from .environment.local_environment import LocalEnvironment
  from .errors import ExecutionError, LaunchError
  from .runner.abstract import AbstractRun
  from .utils import LAUNCH_CONFIG_FILE, LAUNCH_DEFAULT_PROJECT, PROJECT_SYNCHRONOUS, construct_launch_spec, validate_launch_spec_source
label_desc: Use image node_id 4 for calling a global function with example usage: launch(api, job, entry_point, version, name, resource, resource_args, project, entity, docker_image, config, synchronous, run_id, repository) and returns: submitted_run_obj