code: def _adapt_lazy_stream(
      generator, transform_groups, initial_transform_group
  ):
      """
      A simple internal utility to apply transforms and dataset type to all lazily
      generated datasets. Used in the :func:`create_lazy_generic_benchmark`
      benchmark creation helper.
  
      :return: A datasets in which the proper transformation groups and dataset
          type are applied.
      """
  
      for dataset in generator:
          dataset = _make_taskaware_classification_dataset(
              dataset,
              transform_groups=transform_groups,
              initial_transform_group=initial_transform_group,
          )
          yield dataset
  
file_path: avalanche/avalanche/benchmarks/scenarios/deprecated/generic_benchmark_creation.py
imports: from pathlib import Path
  from typing import Generator, List, Mapping, Sequence, Union, Any, Tuple, Dict, Optional, Iterable, NamedTuple
  from avalanche.benchmarks.utils.classification_dataset import _make_taskaware_tensor_classification_dataset, _make_taskaware_classification_dataset
  from avalanche.benchmarks.utils import SupportedDataset, FilelistDataset, PathsDataset, common_paths_root
  from avalanche.benchmarks.utils.classification_dataset import TaskAwareClassificationDataset
  from avalanche.benchmarks.scenarios.deprecated.classification_scenario import GenericCLScenario
label_desc: Use image node_id 2 for calling a global function with example usage: _adapt_lazy_stream(generator, transform_groups, initial_transform_group) without return types