code: def _patch_wandb_run(monkeypatch, config=None):
      if not config:
          config = {"launch": {"overrides": {"run_config": {}}}}
      mocked_run = Mock(["finish", "id"])
      mocked_run.config = config
      mocked_run.id = "sweep-scheduler"
      monkeypatch.setattr(
          "wandb.sdk.launch.sweeps.scheduler.Scheduler._init_wandb_run",
          lambda _x: mocked_run,
      )
  
imports: import asyncio
  from typing import Dict
  from unittest.mock import Mock, patch
  import pytest
  import wandb
  from wandb.apis import internal, public
  from wandb.errors import CommError
  from wandb.sdk.launch.sweeps import SchedulerError, load_scheduler
  from wandb.sdk.launch.sweeps.scheduler import RunState, Scheduler, SchedulerState, SweepRun
  from wandb.sdk.launch.sweeps.scheduler_sweep import SweepScheduler
  from wandb.sdk.launch.sweeps.utils import construct_scheduler_args
  from .test_wandb_sweep import VALID_SWEEP_CONFIGS_MINIMAL
label_desc: Use image node_id 2 for calling a global function with example usage: _patch_wandb_run(monkeypatch, config) without return types