code: def _execute_cmd(func, flow_name, run_id, user, my_runs, echo):
      if user and my_runs:
          raise CommandException(
              "--user and --my-runs are mutually exclusive."
          )
  
      if run_id and my_runs:
          raise CommandException(
              "--run_id and --my-runs are mutually exclusive."
          )
  
      if my_runs:
          user = util.get_username()
  
      latest_run = True
  
      if user and not run_id:
          latest_run = False
  
      if not run_id and latest_run:
          run_id = util.get_latest_run_id(echo, flow_name)
          if run_id is None:
              raise CommandException(
                  "A previous run id was not found. Specify --run-id."
              )
  
      func(flow_name, run_id, user, echo)
  
file_path: metaflow/metaflow/plugins/aws/batch/batch_cli.py
imports: from metaflow._vendor import click
  import os
  import sys
  import time
  import traceback
  from metaflow import util
  from metaflow import R
  from metaflow.exception import CommandException, METAFLOW_EXIT_DISALLOW_RETRY
  from metaflow.metadata.util import sync_local_metadata_from_datastore
  from metaflow.metaflow_config import DATASTORE_LOCAL_DIR
  from metaflow.mflog import TASK_LOG_SOURCE
  from .batch import Batch, BatchKilledException
label_desc: Use image node_id 3 for calling a global function with example usage: _execute_cmd(func, flow_name, run_id, user, my_runs, echo) without return types