class_docstr: Private class used to wrap a dataset with a transformation group.
  
  Do not use outside of this file.
class_docstr_tok: ["Private","class","used","to","wrap","a","dataset","with","a","transformation","group",".","Do","not","use","outside","of","this","file","."]
code: def __init__(
      self,
      datasets: Sequence[IDataset[T_co]],
      *,
      indices: Optional[List[int]] = None,
      transform_groups: Optional[TransformGroups] = None,
      frozen_transform_groups: Optional[TransformGroups] = None,
  ):
      can_flatten = (transform_groups is None) and (
          frozen_transform_groups is None
      )
      super().__init__(
          datasets, indices=indices, can_flatten=can_flatten
      )
      if isinstance(transform_groups, dict):
          transform_groups = TransformGroups(transform_groups)
      if isinstance(frozen_transform_groups, dict):
          frozen_transform_groups = TransformGroups(
              frozen_transform_groups
          )
  
      if transform_groups is None:
          transform_groups = EmptyTransformGroups()
  
      if frozen_transform_groups is None:
          frozen_transform_groups = EmptyTransformGroups()
  
      self._transform_groups: TransformGroups = transform_groups
      self._frozen_transform_groups: TransformGroups = (
          frozen_transform_groups
      )
  
      ####################################
      # Init transformations
      ####################################
      cgroup = None
      # inherit transformation group from original dataset
      for dd in datasets:
          if isinstance(dd, _FlatDataWithTransform):
              if cgroup is None and dd._transform_groups is not None:
                  cgroup = dd._transform_groups.current_group
              elif (
                  dd._transform_groups is not None
                  and dd._transform_groups.current_group != cgroup
              ):
                  # all datasets must have the same transformation group
                  warnings.warn(
                      f"Concatenated datasets have different transformation "
                      f"groups. Using group={cgroup}."
                  )
  
      if cgroup is None:
          cgroup = "train"
      self._frozen_transform_groups.current_group = cgroup
      self._transform_groups.current_group = cgroup
  
imports: import copy
  import warnings
  import numpy
  from torch.utils.data.dataloader import default_collate
  from avalanche.benchmarks.utils.dataset_definitions import IDataset
  from .data_attribute import DataAttribute
  from typing import Dict, List, Any, Optional, Sequence, TypeVar, Callable, Union, overload
  from .flat_data import FlatData
  from .transform_groups import TransformGroups, EmptyTransformGroups
  from torch.utils.data import Dataset
  from collections import OrderedDict
label_desc: Use image node_id 1 to create a new _FlatDataWithTransform object from inherited base classes: FlatData with example: obj = _FlatDataWithTransform(datasets)