code: def _apply_postprocessing_stack(
      results: ResultBatch,
      postprocessing_stack: List[BatchPostProcessingFn],
  ) -> ResultBatch:
      """Applies the postprocessing and cotransform postprocessing functions in a Last-In-First-Out LIFO manner.
  
      Args:
          results (ResultBatch): The numeric outcome from executing a batch of :class:`~.QuantumTape`
  
      Keyword Args:
          postprocessing_stack (List(BatchPostProcessingFn)): a LIFO stack of post processing functions.
  
      Returns:
          ResultBatch: the post processed results.
  
      >>> results = (1.0, 2.0, 3.0, 4.0)
      >>> def postprocessing1(results):
      ...     return (results[0] + results[1], results[2] + results[3])
      >>> def postprocessing2(results):
      .... return (results[0] + 1, results[1] + 2)
      >>> _apply_postprocessing_stack(results, [postprocessing1])
      (3.0, 7.0)
      >>> _apply_postprocessing_stack(results, [postprocessing2, postprocessing1])
      (4.0, 9.0)
  
      """
      for postprocessing in reversed(postprocessing_stack):
          results = postprocessing(results)
      return results
  
imports: from functools import partial
  from typing import Callable, List, Tuple, Optional, Sequence
  import pennylane
  from pennylane.typing import Result, ResultBatch
  from pennylane.tape import QuantumTape
  from .transform_dispatcher import TransformContainer, TransformError, TransformDispatcher
label_desc: Use image node_id 2 for calling a global function with example usage: _apply_postprocessing_stack(results, postprocessing_stack) and returns: results