code: def main(cfg: DictConfig) -> None:
      db, cfg = load_db_and_process_config(cfg)
  
      teacher = get_teacher(cfg)
      world_opt = {"turn_timeout": cfg.turn_timeout, "teacher": teacher}
  
      custom_bundle_path = cfg.mephisto.blueprint.get(
          "custom_source_bundle", None
      )
      if custom_bundle_path is not None:
          if not os.path.exists(custom_bundle_path):
              build_task(TASK_DIRECTORY)
  
      shared_state = SharedParlAITaskState(
          world_opt=world_opt, onboarding_world_opt=world_opt
      )
  
      operator = Operator(db)
      operator.validate_and_run_config(
          run_config=cfg.mephisto, shared_state=shared_state
      )
      operator.wait_for_runs_then_shutdown(
          skip_input=True, log_rate=cfg.monitoring_log_rate
      )
  
file_path: ParlAI/parlai/crowdsourcing/tasks/qa_data_collection/run.py
imports: import os
  from dataclasses import dataclass, field
  from typing import List, Any
  import hydra
  from omegaconf import DictConfig
  from mephisto.abstractions.blueprints.parlai_chat.parlai_chat_blueprint import SharedParlAITaskState
  from mephisto.operations.hydra_config import register_script_config
  from mephisto.operations.operator import Operator
  from mephisto.tools.scripts import load_db_and_process_config
  from parlai.crowdsourcing.tasks.qa_data_collection.util import get_teacher
  from parlai.crowdsourcing.utils.frontend import build_task
  from parlai.crowdsourcing.utils.mturk import MTurkRunScriptConfig
label_desc: Use image node_id 1 for calling a global function with example usage: main(cfg) without return types