code: def validate_run_id(
      workflow_name,
      token_prefix,
      authorize,
      run_id,
      instructions_fn=None,
  ):
      """
      Validates that a run_id adheres to the Argo Workflows naming rules, and
      that it belongs to the current flow (accounting for project branch as well).
      """
      # Verify that user is trying to change an Argo workflow
      if not run_id.startswith("argo-"):
          raise RunIdMismatch(
              "Run IDs for flows executed through Argo Workflows begin with 'argo-'"
          )
  
      # Verify that run_id belongs to the Flow, and that branches match
      name = run_id[5:]
      workflow = ArgoWorkflows.get_execution(name)
      if workflow is None:
          raise MetaflowException(
              "Could not find workflow *%s* on Argo Workflows" % name
          )
  
      owner, token, flow_name, branch_name, project_name = workflow
  
      # Verify we are operating on the correct Flow file compared to the running one.
      # Without this check, using --name could be used to run commands for arbitrary run_id's, disregarding the Flow in the file.
      if current.flow_name != flow_name:
          raise RunIdMismatch(
              "The workflow with the run_id *%s* belongs to the flow *%s*, not for the flow *%s*."
              % (run_id, flow_name, current.flow_name)
          )
  
      if project_name is not None:
          # Verify we are operating on the correct project.
          # Perform match with separators to avoid substrings matching
          # e.g. 'test_proj' and 'test_project' should count as a mismatch.
          project_part = "%s." % sanitize_for_argo(project_name)
          if (
              current.get("project_name") != project_name
              and project_part not in workflow_name
          ):
              raise RunIdMismatch(
                  "The workflow belongs to the project *%s*. "
                  "Please use the project decorator or --name to target the correct project"
                  % project_name
              )
  
          # Verify we are operating on the correct branch.
          # Perform match with separators to avoid substrings matching.
          # e.g. 'user.tes' and 'user.test' should count as a mismatch.
          branch_part = ".%s." % sanitize_for_argo(branch_name)
          if (
              current.get("branch_name") != branch_name
              and branch_part not in workflow_name
          ):
              raise RunIdMismatch(
                  "The workflow belongs to the branch *%s*. "
                  "Please use --branch, --production or --name to target the correct branch"
                  % branch_name
              )
  
      # Verify that the production tokens match. We do not want to cache the token that was used though,
      # as the operations that require run_id validation can target runs not authored from the local environment
      if authorize is None:
          authorize = load_token(token_prefix)
      elif authorize.startswith("production:"):
          authorize = authorize[11:]
  
      if owner != get_username() and authorize != token:
          if instructions_fn:
              instructions_fn(flow_name=name, prev_user=owner)
          raise IncorrectProductionToken(
              "Try again with the correct production token."
          )
  
      return True
  
imports: import base64
  import json
  import platform
  import re
  import sys
  from hashlib import sha1
  from metaflow import JSONType, current, decorators, parameters
  from metaflow._vendor import click
  from metaflow.exception import MetaflowException, MetaflowInternalError
  from metaflow.metaflow_config import ARGO_WORKFLOWS_UI_URL, KUBERNETES_NAMESPACE, SERVICE_VERSION_CHECK, UI_URL
  from metaflow.package import MetaflowPackage
  from metaflow.plugins.aws.step_functions.production_token import load_token, new_token, store_token
  from metaflow.plugins.environment_decorator import EnvironmentDecorator
  from metaflow.plugins.kubernetes.kubernetes_decorator import KubernetesDecorator
  from metaflow.tagging_util import validate_tags
  from metaflow.util import get_username, to_bytes, to_unicode, version_parse
  from .argo_workflows import ArgoWorkflows
label_desc: Use image node_id 17 for calling a global function with example usage: validate_run_id(workflow_name, token_prefix, authorize, run_id, instructions_fn) and returns: True