class_docstr: Main class from which all Flows should inherit.
  
  Attributes
  ----------
  index
  input
docstr: Returns the current stack of foreach indexes and values for the current step.
  
  Use this information to understand what data is being processed in the current
  foreach branch. For example, considering the following code:
  ```
  @step
  def root(self):
      self.split_1 = ['a', 'b', 'c']
      self.next(self.nest_1, foreach='split_1')
  
  @step
  def nest_1(self):
      self.split_2 = ['d', 'e', 'f', 'g']
      self.next(self.nest_2, foreach='split_2'):
  
  @step
  def nest_2(self):
      foo = self.foreach_stack()
  ```
  
  `foo` will take the following values in the various tasks for nest_2:
  ```
      [(0, 3, 'a'), (0, 4, 'd')]
      [(0, 3, 'a'), (1, 4, 'e')]
      ...
      [(0, 3, 'a'), (3, 4, 'g')]
      [(1, 3, 'b'), (0, 4, 'd')]
      ...
  ```
  where each tuple corresponds to:
  
  - The index of the task for that level of the loop.
  - The number of splits for that level of the loop.
  - The value for that level of the loop.
  
  Note that the last tuple returned in a task corresponds to:
  
  - 1st element: value returned by `self.index`.
  - 3rd element: value returned by `self.input`.
  
  Returns
  -------
  List[Tuple[int, int, object]]
      An array describing the current stack of foreach steps.
code: def foreach_stack(self) -> Optional[List[Tuple[int, int, Any]]]:
      """
      Returns the current stack of foreach indexes and values for the current step.
  
      Use this information to understand what data is being processed in the current
      foreach branch. For example, considering the following code:
      ```
      @step
      def root(self):
          self.split_1 = ['a', 'b', 'c']
          self.next(self.nest_1, foreach='split_1')
  
      @step
      def nest_1(self):
          self.split_2 = ['d', 'e', 'f', 'g']
          self.next(self.nest_2, foreach='split_2'):
  
      @step
      def nest_2(self):
          foo = self.foreach_stack()
      ```
  
      `foo` will take the following values in the various tasks for nest_2:
      ```
          [(0, 3, 'a'), (0, 4, 'd')]
          [(0, 3, 'a'), (1, 4, 'e')]
          ...
          [(0, 3, 'a'), (3, 4, 'g')]
          [(1, 3, 'b'), (0, 4, 'd')]
          ...
      ```
      where each tuple corresponds to:
  
      - The index of the task for that level of the loop.
      - The number of splits for that level of the loop.
      - The value for that level of the loop.
  
      Note that the last tuple returned in a task corresponds to:
  
      - 1st element: value returned by `self.index`.
      - 3rd element: value returned by `self.input`.
  
      Returns
      -------
      List[Tuple[int, int, object]]
          An array describing the current stack of foreach steps.
      """
      return [
          (
              frame.index,
              frame.num_splits,
              self._find_input(stack_index=i),
          )
          for i, frame in enumerate(self._foreach_stack)
      ]
  
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 11 for calling the FlowSpec obj's underlying member method code with example usage: obj.foreach_stack() and returns: unknown