code: def EndlessCLSim(
      *,
      scenario: str = _scenario_names[0],
      patch_size: int = 64,
      sequence_order: Optional[List[int]] = None,
      task_order: Optional[List[int]] = None,
      train_transform: Optional[Any] = _default_transform,
      eval_transform: Optional[Any] = _default_transform,
      dataset_root: Optional[Union[str, Path]] = None,
      semseg=False,
  ):
      """Creates a CL scenario for the Endless-Continual-Learning Simulator's
      derived `datasets <https://zenodo.org/record/4899267>`__, or custom
      datasets created from
      the Endless-Continual-Learning-Simulator's `standalone application <
      https://zenodo.org/record/4899294>`__.
      Both are part of the publication of `A Procedural World Generation
      Framework for Systematic Evaluation of Continual Learning
      <https://arxiv.org/abs/2106.02585>`__.
  
      If the dataset is not present in the computer, this method will
      automatically download and store it.
  
      All generated scenarios make use of 'task labels'. We regard a full dataset
      as one learning 'sequence', aligned to the terminology in the above paper,
      with 'subsequences' being the iterative learning tasks. Each subsequence
      is realized as one `AvalancheDataset` with ordering inforaced by task
      labels.
  
      :param scenario: Available, predefined, learning scenarios are:
          'Classes': An learning scenario based on incremental availability of
          object class examples,
          'Illumination': A learning scenario based on iteratively decreasing
          scene illumination.
          'Weather': A learning scenario based on iteratively shifting weather
          conditions.
      :param patch_size: The dimension of the image-patches. Int in the case of
              image-patch classification, because the image-patches need to be
              quadratic. Tuple of integers for image segmentation tasks.
      :param sequence_order: List of intergers indexing the subsequences,
              enables reordering of the subsequences, especially subsequences can
              be omitted. Defaults to None, loading subsequences in their
              original order.
      :param task_order: List of intergers, assigning task labels to each
              respective subsequence.
      :param train_transform: The transformation to apply to the training data.
              Defaults to `_default_transform`, i.e. conversion ToTensor of
              torchvision.
      :param eval_transform: The transformation to apply to the eval data.
              Defaults to `_default_transform`, i.e. conversion ToTensor of
              torchvision.
      :param dataset_root: Absolute path indicating where to store the dataset.
              Defaults to None, which means the default location for
              'endless-cl-sim' will be used.
      :param semseg: boolean to indicate the use of targets for a semantic
              segmentation task. Defaults to False.
  
      :returns: A properly initialized :class:`EndlessCLSim` instance.
      """
      # Check scenario name is valid
      assert scenario in _scenario_names, (
          "The selected scenario is not "
          "recognized: it should be "
          "'Classes', 'Illumination', "
          "or 'Weather'."
      )
  
      # Assign default dataset root if None provided
      if dataset_root is None:
          dataset_root = default_dataset_location("endless-cl-sim")
  
      # Download and prepare the dataset
      endless_cl_sim_dataset = EndlessCLSimDataset(
          root=dataset_root,
          scenario=scenario,
          transform=None,
          download=True,
          semseg=semseg,
      )
  
      # Default sequence_order if None
      if sequence_order is None:
          sequence_order = list(range(len(endless_cl_sim_dataset)))
  
      # Default sequence_order if None
      if task_order is None:
          task_order = list(range(len(endless_cl_sim_dataset)))
  
      train_datasets = []
      eval_datasets = []
      for i in range(len(sequence_order)):
          train_data, eval_data = endless_cl_sim_dataset[
              sequence_order[i]
          ]
  
          train_data.transform = train_transform
          eval_data.transform = eval_transform
  
          train_datasets.append(
              _make_taskaware_classification_dataset(
                  dataset=train_data, task_labels=task_order[i]
              )
          )
          eval_datasets.append(
              _make_taskaware_classification_dataset(
                  dataset=eval_data, task_labels=task_order[i]
              )
          )
  
      scenario_obj = dataset_benchmark(train_datasets, eval_datasets)
  
      return scenario_obj
  
file_path: avalanche/avalanche/benchmarks/classic/endless_cl_sim.py
imports: from avalanche.benchmarks.datasets.endless_cl_sim.endless_cl_sim import EndlessCLSimDataset
  from pathlib import Path
  from typing import List, Union, Optional, Any
  from torchvision.transforms import ToTensor
  from torchvision.transforms.transforms import Compose
  from avalanche.benchmarks.datasets import default_dataset_location
  from avalanche.benchmarks.scenarios.deprecated.generators import dataset_benchmark
  from avalanche.benchmarks.utils import _make_taskaware_classification_dataset
label_desc: Use image node_id 1 for calling a global function with example usage: EndlessCLSim() and returns: scenario_obj