code: def test(self):
      # Given
      model = AbsModel()
      herding = HerdingSelectionStrategy(model, "features")
      closest_to_center = ClosestToCenterSelectionStrategy(
          model, "features"
      )
  
      # When
      # Features are [[0], [4], [5]]
      # Center is [3]
      dataset = _make_taskaware_tensor_classification_dataset(
          tensor([0, -4, 5]).float(), zeros(3)
      )
      strategy = MagicMock(device="cpu", eval_mb_size=8)
  
      # Then
  
      # Herding:
  
      # 1. At first pass, we select the -4 (at index 1)
      #  because it is the closest ([4]) to the center in feature space
      # 2. At second pass, we select 0 (of index 0)
      #  because the center will be [2], closest to [3] than the center
      #  obtained if we were to select 5 ([4.5])
      # 3. Finally we select the last remaining exemplar
      self.assertSequenceEqual(
          [1, 0, 2], herding.make_sorted_indices(strategy, dataset)
      )
      # Closest to center
  
      # -4 (index 1) is the closest to the center in feature space.
      # Then 5 (index 2) is closest than 0 (index 0)
      self.assertSequenceEqual(
          [1, 2, 0],
          closest_to_center.make_sorted_indices(strategy, dataset),
      )
  
imports: import unittest
  from typing import List
  from unittest.mock import MagicMock
  import torch
  from torch import tensor, Tensor, zeros
  from torch.nn import CrossEntropyLoss, Module, Identity
  from torch.optim import SGD
  from avalanche.benchmarks.utils import _make_taskaware_classification_dataset, _make_taskaware_tensor_classification_dataset
  from avalanche.benchmarks.utils.data import AvalancheDataset
  from avalanche.benchmarks.utils.flat_data import _flatdata_depth
  from avalanche.models import SimpleMLP
  from avalanche.training.plugins import ReplayPlugin
  from avalanche.training.storage_policy import ExperienceBalancedBuffer, ClassBalancedBuffer, ExemplarsSelectionStrategy, HerdingSelectionStrategy, ClosestToCenterSelectionStrategy, ParametricBuffer, ReservoirSamplingBuffer
  from avalanche.training.supervised import Naive
  from avalanche.training.templates import SupervisedTemplate
  from tests.unit_tests_utils import get_fast_benchmark
  import time
label_desc: Use image node_id 1 for calling the SelectionStrategyTest obj's underlying member method code with example usage: obj.test() without return types