docstr: This method should always be used with any kind of iterable to ensure its fault tolerant.
  
  If you want your iterable to always be consumed from scratch, you shouldn't use this method.
  
  Arguments:
      iterable: Iterable to iterate over. The iterable shouldn't have side effects or be random.
      run_once: Whether to run the entire iteration only once.
          Otherwise, it would restart from the beginning.
      user_key: Key to be used to track the caching mechanism.
docstr_tok: ["This","method","should","always","be","used","with","any","kind","of","iterable","to","ensure","its","fault","tolerant",".","If","you","want","your","iterable","to","always","be","consumed","from","scratch",",","you","should","n't","use","this","method",".","Arguments",":","iterable",":","Iterable","to","iterate","over",".","The","iterable","should","n't","have","side","effects","or","be","random",".","run_once",":","Whether","to","run","the","entire","iteration","only","once",".","Otherwise",",","it","would","restart","from","the","beginning",".","user_key",":","Key","to","be","used","to","track","the","caching","mechanism","."]
code: def experimental_iterate(
      self,
      iterable: Iterable,
      run_once: bool = True,
      user_key: str = "",
  ) -> Generator:
      """This method should always be used with any kind of iterable to ensure its fault tolerant.
  
      If you want your iterable to always be consumed from scratch, you shouldn't use this method.
  
      Arguments:
          iterable: Iterable to iterate over. The iterable shouldn't have side effects or be random.
          run_once: Whether to run the entire iteration only once.
              Otherwise, it would restart from the beginning.
          user_key: Key to be used to track the caching mechanism.
  
      """
      if not isinstance(iterable, Iterable):
          raise TypeError(
              f"An iterable should be provided to `self.iterate` method. Found {iterable}"
          )
  
      # TODO: Find a better way. Investigated using __reduce__, but state change invalidate the cache.
      if not user_key:
          frame = cast(FrameType, inspect.currentframe()).f_back
          assert frame is not None
          cache_key = f"{frame.f_code.co_filename}.{frame.f_code.co_firstlineno}"
      else:
          cache_key = user_key
  
      call_hash = f"{self.experimental_iterate.__name__}:{DeepHash(cache_key)[cache_key]}"
      entered = call_hash in self._calls
      has_started = entered and self._calls[call_hash]["counter"] > 0
      has_finished = entered and self._calls[call_hash]["has_finished"]
  
      if has_finished:
          if not run_once:
              self._calls[call_hash].update(
                  {"counter": 0, "has_finished": False}
              )
          else:
              return range(0)
  
      if not has_started:
          self._calls[call_hash] = {
              "name": self.experimental_iterate.__name__,
              "call_hash": call_hash,
              "counter": 0,
              "has_finished": False,
          }
  
      skip_counter = max(self._calls[call_hash]["counter"], 0)
  
      for counter, value in enumerate(iterable):
          if skip_counter:
              skip_counter -= 1
              continue
          self._calls[call_hash].update({"counter": counter})
          yield value
  
      self._calls[call_hash].update({"has_finished": True})
  
imports: import inspect
  import warnings
  from copy import deepcopy
  from datetime import datetime
  from types import FrameType
  from typing import TYPE_CHECKING, Any, Dict, Generator, Iterable, List, Optional, Tuple, Union, cast
  from deepdiff import DeepHash
  from lightning.app.core.work import LightningWork
  from lightning.app.frontend import Frontend
  from lightning.app.storage.drive import Drive, _maybe_create_drive
  from lightning.app.storage.path import Path
  from lightning.app.utilities.app_helpers import _is_json_serializable, _LightningAppRef, _set_child_name, is_overridden
  from lightning.app.utilities.component import _sanitize_state
  from lightning.app.utilities.exceptions import ExitAppException, LightningFlowException
  from lightning.app.utilities.introspection import _is_init_context, _is_run_context
  from lightning.app.utilities.packaging.cloud_compute import CloudCompute, _maybe_create_cloud_compute
label_desc: Use image node_id 26 for calling the LightningFlow obj's underlying member method code with example usage: obj.experimental_iterate(iterable, run_once, user_key) and returns: range