code: def __iter__(self) -> Generator[OnlineCLExperience, None, None]:
      exp_dataset = self.experience.dataset
      exp_indices = list(range(len(exp_dataset)))
  
      g = torch.Generator()
      g.manual_seed(self.seed)
  
      if self.shuffle:
          exp_indices = torch.as_tensor(exp_indices)[
              torch.randperm(len(exp_indices), generator=g)
          ].tolist()
      sub_stream_length = len(exp_indices) // self.experience_size
      if (
          not self.drop_last
          and len(exp_indices) % self.experience_size > 0
      ):
          sub_stream_length += 1
  
      init_idx = 0
      is_first = True
      is_last = False
      exp_idx = 0
      while init_idx < len(exp_indices):
          final_idx = init_idx + self.experience_size  # Exclusive
  
          if final_idx > len(exp_indices):
              if self.drop_last:
                  break
  
              final_idx = len(exp_indices)
              is_last = True
  
          # check is_last when drop_last=True
          if self.drop_last and (
              final_idx + self.experience_size > len(exp_indices)
          ):
              is_last = True
  
          sub_exp_subset = exp_dataset.subset(
              exp_indices[init_idx:final_idx]
          )
          exp = OnlineCLExperience(
              dataset=sub_exp_subset,
              origin_experience=self.experience,
              is_first_subexp=is_first,
              is_last_subexp=is_last,
              sub_stream_length=sub_stream_length,
              access_task_boundaries=self.access_task_boundaries,
          )
  
          is_first = False
          yield exp
          init_idx = final_idx
          exp_idx += 1
  
imports: from functools import partial
  import random
  from typing import Callable, Generator, Generic, Iterable, List, Optional, TypeVar, Union, Protocol
  from typing_extensions import Literal
  import warnings
  from avalanche.benchmarks.utils.data import AvalancheDataset
  from avalanche.benchmarks.utils.utils import concat_datasets
  import torch
  from torch.distributions.categorical import Categorical
  from torch.utils.data import Sampler
  from .deprecated.benchmark_wrapper_utils import wrap_stream
  from .generic_scenario import CLStream, CLScenario
  from .dataset_scenario import DatasetExperience
label_desc: Use image node_id 2 for calling the FixedSizeExperienceSplitter obj's underlying member method code with example usage: obj.__iter__() without return types