code: def _handle_launch_config(settings: "Settings") -> Dict[str, Any]:
      launch_run_config: Dict[str, Any] = {}
      if not settings.launch:
          return launch_run_config
      if os.environ.get("WANDB_CONFIG") is not None:
          try:
              launch_run_config = json.loads(
                  os.environ.get("WANDB_CONFIG", "{}")
              )
          except (ValueError, SyntaxError):
              wandb.termwarn(
                  "Malformed WANDB_CONFIG, using original config"
              )
      elif settings.launch_config_path and os.path.exists(
          settings.launch_config_path
      ):
          with open(settings.launch_config_path) as fp:
              launch_config = json.loads(fp.read())
          launch_run_config = launch_config.get("overrides", {}).get(
              "run_config"
          )
      else:
          i = 0
          chunks = []
          while True:
              key = f"WANDB_CONFIG_{i}"
              if key in os.environ:
                  chunks.append(os.environ[key])
                  i += 1
              else:
                  break
          if len(chunks) > 0:
              config_string = "".join(chunks)
              try:
                  launch_run_config = json.loads(config_string)
              except (ValueError, SyntaxError):
                  wandb.termwarn(
                      "Malformed WANDB_CONFIG, using original config"
                  )
  
      return launch_run_config
  
imports: import copy
  import json
  import logging
  import os
  import platform
  import sys
  import tempfile
  import traceback
  from typing import TYPE_CHECKING, Any, Dict, List, Optional, Sequence, Union
  import wandb
  import wandb.env
  from wandb import trigger
  from wandb.errors import CommError, Error, UsageError
  from wandb.errors.util import ProtobufErrorHandler
  from wandb.integration import sagemaker
  from wandb.integration.magic import magic_install
  from wandb.sdk.lib import runid
  from wandb.sdk.lib.paths import StrPath
  from wandb.util import _is_artifact_representation
  from .None import wandb_login, wandb_setup
  from .backend.backend import Backend
  from .lib import RunDisabled, SummaryDisabled, filesystem, ipython, module, reporting, telemetry
  from .lib.deprecate import Deprecated, deprecate
  from .lib.mailbox import Mailbox, MailboxProgress
  from .lib.printer import Printer, get_printer
  from .lib.wburls import wburls
  from .wandb_helper import parse_config
  from .wandb_run import Run, TeardownHook, TeardownStage
  from .wandb_settings import Settings, Source
label_desc: Use image node_id 4 for calling a global function with example usage: _handle_launch_config(settings) and returns: launch_run_config, launch_run_config