class_docstr: MetaflowTask prepares a Flow instance for execution of a single step.
class_docstr_tok: ["MetaflowTask","prepares","a","Flow","instance","for","execution","of","a","single","step","."]
code: def _finalize_control_task(self):
      # Update `_transition` which is expected by the NativeRuntime.
      step_name = self.flow._current_step
      next_steps = self.flow._graph[step_name].out_funcs
      self.flow._transition = (next_steps, None)
      if self.flow._task_ok:
          # Throw an error if `_control_mapper_tasks` isn't populated.
          mapper_tasks = self.flow._control_mapper_tasks
          if not mapper_tasks:
              msg = (
                  "Step *{step}* has a control task which didn't "
                  "specify the artifact *_control_mapper_tasks* for "
                  "the subsequent *{join}* step."
              )
              raise MetaflowInternalError(
                  msg.format(step=step_name, join=next_steps[0])
              )
          elif not (
              isinstance(mapper_tasks, list)
              and isinstance(mapper_tasks[0], unicode_type)
          ):
              msg = (
                  "Step *{step}* has a control task which didn't "
                  "specify the artifact *_control_mapper_tasks* as a "
                  "list of strings but instead specified it as {typ} "
                  "with elements of {elem_typ}."
              )
              raise MetaflowInternalError(
                  msg.format(
                      step=step_name,
                      typ=type(mapper_tasks),
                      elem_typ=type(mapper_tasks[0]),
                  )
              )
  
imports: from __future__ import print_function
  from io import BytesIO
  import math
  import sys
  import os
  import time
  from types import MethodType, FunctionType
  from metaflow.datastore.exceptions import DataException
  from .metaflow_config import MAX_ATTEMPTS
  from .metadata import MetaDatum
  from .mflog import TASK_LOG_SOURCE
  from .datastore import Inputs, TaskDataStoreSet
  from .exception import MetaflowInternalError, MetaflowDataMissing, MetaflowExceptionWrapper
  from .unbounded_foreach import UBF_CONTROL
  from .util import all_equal, get_username, resolve_identity, unicode_type
  from .current import current
  from metaflow.tracing import get_trace_id
  from collections import namedtuple
label_desc: Use image node_id 8 for calling the MetaflowTask obj's underlying member method code with example usage: obj._finalize_control_task() without return types