class_docstr: Main class from which all Flows should inherit.
  
  Attributes
  ----------
  index
  input
docstr: The index of this foreach branch.
  
  In a foreach step, multiple instances of this step (tasks) will be executed,
  one for each element in the foreach. This property returns the zero based index
  of the current task. If this is not a foreach step, this returns None.
  
  If you need to know the indices of the parent tasks in a nested foreach, use
  `FlowSpec.foreach_stack`.
  
  Returns
  -------
  int, optional
      Index of the task in a foreach step.
code: def index(self) -> Optional[int]:
      """
      The index of this foreach branch.
  
      In a foreach step, multiple instances of this step (tasks) will be executed,
      one for each element in the foreach. This property returns the zero based index
      of the current task. If this is not a foreach step, this returns None.
  
      If you need to know the indices of the parent tasks in a nested foreach, use
      `FlowSpec.foreach_stack`.
  
      Returns
      -------
      int, optional
          Index of the task in a foreach step.
      """
      if self._foreach_stack:
          return self._foreach_stack[-1].index
  
imports: import inspect
  import os
  import sys
  import traceback
  from itertools import islice
  from types import FunctionType, MethodType
  from typing import Any, Callable, List, Optional, Tuple
  from .None import cmd_with_io
  from .parameters import DelayedEvaluationParameter, Parameter
  from .exception import MetaflowException, MissingInMergeArtifactsException, UnhandledInMergeArtifactsException
  from .graph import FlowGraph
  from .unbounded_foreach import UnboundedForeachInput
  from .datastore.inputs import Inputs
label_desc: Use image node_id 9 for calling the FlowSpec obj's underlying member method code with example usage: obj.index() and returns: self