code: def detection_subset(
      dataset: SupportedDetectionDataset,
      indices: Optional[Sequence[int]] = None,
      *,
      class_mapping: Optional[Sequence[int]] = None,
      transform: Optional[XTransform] = None,
      target_transform: Optional[YTransform] = None,
      transform_groups: Optional[
          Mapping[str, Tuple[XTransform, YTransform]]
      ] = None,
      initial_transform_group: Optional[str] = None,
      task_labels: Optional[Union[int, Sequence[int]]] = None,
      targets: Optional[Sequence[TTargetType]] = None,
      collate_fn: Optional[Callable[[List], Any]] = None,
  ) -> DetectionDataset:
      ...
  
imports: from functools import partial
  from typing import List, Any, Sequence, Union, Optional, TypeVar, Callable, Dict, Tuple, Mapping, overload
  import torch
  from torch import Tensor
  from torch.utils.data.dataset import Subset, ConcatDataset
  from avalanche.benchmarks.utils.utils import TaskSet, _init_task_labels, _init_transform_groups, _split_user_def_targets, _split_user_def_task_label, _traverse_supported_dataset
  from .collate_functions import detection_collate_fn
  from .data import AvalancheDataset
  from .data_attribute import DataAttribute
  from .dataset_definitions import IDataset, IDatasetWithTargets
  from .dataset_utils import SubSequence
  from .flat_data import ConstantSequence
  from .transform_groups import TransformGroupDef, DefaultTransformGroups, TransformGroups, XTransform, YTransform
label_desc: Use image node_id 9 for calling a global function with example usage: detection_subset(dataset, indices) without return types