code: def run_static_task(
      cfg: DictConfig, task_directory: str, task_id: str
  ):
      """
      Run static task, given configuration.
      """
  
      db, cfg = load_db_and_process_config(cfg)
      print(f"\nHydra config:\n{OmegaConf.to_yaml(cfg)}")
  
      random.seed(42)
  
      task_name = cfg.mephisto.task.get("task_name", task_id)
      soft_block_qual_name = cfg.mephisto.blueprint.get(
          "block_qualification", f"{task_name}_block"
      )
      # Default to a task-specific name to avoid soft-block collisions
      soft_block_mturk_workers(
          cfg=cfg, db=db, soft_block_qual_name=soft_block_qual_name
      )
  
      build_task(task_directory)
  
      operator = Operator(db)
      operator.validate_and_run_config(
          run_config=cfg.mephisto, shared_state=None
      )
      operator.wait_for_runs_then_shutdown(
          skip_input=True, log_rate=cfg.monitoring_log_rate
      )
  
file_path: ParlAI/parlai/crowdsourcing/utils/mturk.py
imports: import time
  import random
  from dataclasses import dataclass, field
  from typing import Optional
  from mephisto.abstractions.database import MephistoDB
  from mephisto.abstractions.providers.mturk.mturk_agent import MTurkAgent
  from mephisto.abstractions.providers.mturk.utils.script_utils import direct_soft_block_mturk_workers
  from mephisto.operations.hydra_config import RunScriptConfig
  from mephisto.operations.operator import Operator
  from mephisto.tools.scripts import load_db_and_process_config
  from omegaconf import DictConfig, OmegaConf, MISSING
  from parlai.crowdsourcing.utils.frontend import build_task
label_desc: Use image node_id 3 for calling a global function with example usage: run_static_task(cfg, task_directory, task_id) without return types