code: def create_multi_dataset_generic_benchmark(
      train_datasets: Sequence[SupportedDataset],
      test_datasets: Sequence[SupportedDataset],
      *,
      other_streams_datasets: Optional[
          Mapping[str, Sequence[SupportedDataset]]
      ] = None,
      complete_test_set_only: bool = False,
      train_transform=None,
      train_target_transform=None,
      eval_transform=None,
      eval_target_transform=None,
      other_streams_transforms: Optional[
          Mapping[str, Tuple[Any, Any]]
      ] = None,
  ) -> GenericCLScenario:
      """
      Creates a benchmark instance given a list of datasets. Each dataset will be
      considered as a separate experience.
  
      Contents of the datasets must already be set, including task labels.
      Transformations will be applied if defined.
  
      This function allows for the creation of custom streams as well.
      While "train" and "test" datasets must always be set, the experience list
      for other streams can be defined by using the `other_streams_datasets`
      parameter.
  
      If transformations are defined, they will be applied to the datasets
      of the related stream.
  
      :param train_datasets: A list of training datasets.
      :param test_datasets: A list of test datasets.
      :param other_streams_datasets: A dictionary describing the content of
          custom streams. Keys must be valid stream names (letters and numbers,
          not starting with a number) while the value must be a list of dataset.
          If this dictionary contains the definition for "train" or "test"
          streams then those definition will override the `train_datasets` and
          `test_datasets` parameters.
      :param complete_test_set_only: If True, only the complete test set will
          be returned by the benchmark. This means that the ``test_dataset_list``
          parameter must be list with a single element (the complete test set).
          Defaults to False.
      :param train_transform: The transformation to apply to the training data,
          e.g. a random crop, a normalization or a concatenation of different
          transformations (see torchvision.transform documentation for a
          comprehensive list of possible transformations). Defaults to None.
      :param train_target_transform: The transformation to apply to training
          patterns targets. Defaults to None.
      :param eval_transform: The transformation to apply to the test data,
          e.g. a random crop, a normalization or a concatenation of different
          transformations (see torchvision.transform documentation for a
          comprehensive list of possible transformations). Defaults to None.
      :param eval_target_transform: The transformation to apply to test
          patterns targets. Defaults to None.
      :param other_streams_transforms: Transformations to apply to custom
          streams. If no transformations are defined for a custom stream,
          then "train" transformations will be used. This parameter must be a
          dictionary mapping stream names to transformations. The transformations
          must be a two elements tuple where the first element defines the
          X transformation while the second element is the Y transformation.
          Those elements can be None. If this dictionary contains the
          transformations for "train" or "test" streams then those
          transformations will override the `train_transform`,
          `train_target_transform`, `eval_transform` and
          `eval_target_transform` parameters.
  
      :returns: A :class:`GenericCLScenario` instance.
      """
  
      transform_groups = dict(
          train=(train_transform, train_target_transform),
          eval=(eval_transform, eval_target_transform),
      )
  
      if other_streams_transforms is not None:
          for (
              stream_name,
              stream_transforms,
          ) in other_streams_transforms.items():
              if isinstance(stream_transforms, Sequence):
                  if len(stream_transforms) == 1:
                      # Suppose we got only the transformation for X values
                      stream_transforms = (stream_transforms[0], None)
              else:
                  # Suppose it's the transformation for X values
                  stream_transforms = (stream_transforms, None)
  
              transform_groups[stream_name] = stream_transforms
  
      input_streams = dict(train=train_datasets, test=test_datasets)
  
      if other_streams_datasets is not None:
          input_streams = {**input_streams, **other_streams_datasets}
  
      if complete_test_set_only:
          if len(input_streams["test"]) != 1:
              raise ValueError(
                  "Test stream must contain one experience when"
                  "complete_test_set_only is True"
              )
  
      stream_definitions: Dict[
          str, Tuple[Iterable[TaskAwareClassificationDataset]]
      ] = dict()
  
      for stream_name, dataset_list in input_streams.items():
          initial_transform_group = "train"
          if stream_name in transform_groups:
              initial_transform_group = stream_name
  
          stream_datasets = []
          for dataset_idx in range(len(dataset_list)):
              dataset = dataset_list[dataset_idx]
              stream_datasets.append(
                  _make_taskaware_classification_dataset(
                      dataset,
                      transform_groups=transform_groups,
                      initial_transform_group=initial_transform_group,
                  )
              )
          stream_definitions[stream_name] = (stream_datasets,)
  
      return GenericCLScenario(
          stream_definitions=stream_definitions,
          complete_test_set_only=complete_test_set_only,
      )
  
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 1 for calling a global function with example usage: create_multi_dataset_generic_benchmark(train_datasets, test_datasets) and returns: GenericCLScenario