code: def test_ni_sit_single_dataset(self):
      mnist_train = MNIST(
          root=default_dataset_location("mnist"),
          train=True,
          download=True,
      )
      mnist_test = MNIST(
          root=default_dataset_location("mnist"),
          train=False,
          download=True,
      )
      my_ni_benchmark = ni_benchmark(
          mnist_train,
          mnist_test,
          5,
          shuffle=True,
          seed=1234,
          balance_experiences=True,
      )
  
      self.assertEqual(5, my_ni_benchmark.n_experiences)
      self.assertEqual(10, my_ni_benchmark.n_classes)
      for batch_id in range(5):
          self.assertEqual(
              10,
              len(
                  my_ni_benchmark.classes_in_experience["train"][
                      batch_id
                  ]
              ),
          )
  
      _, unique_count = torch.unique(
          torch.as_tensor(mnist_train.targets), return_counts=True
      )
  
      min_batch_size = torch.sum(
          unique_count // my_ni_benchmark.n_experiences
      ).item()
      max_batch_size = min_batch_size + my_ni_benchmark.n_classes
  
      pattern_count = 0
      batch_info: NIExperience
      for batch_id, batch_info in enumerate(
          my_ni_benchmark.train_stream
      ):
          cur_train_set = batch_info.dataset
          t = batch_info.task_label
          self.assertEqual(0, t)
          self.assertEqual(batch_id, batch_info.current_experience)
          self.assertGreaterEqual(len(cur_train_set), min_batch_size)
          self.assertLessEqual(len(cur_train_set), max_batch_size)
          pattern_count += len(cur_train_set)
      self.assertEqual(len(mnist_train), pattern_count)
  
      self.assertEqual(1, len(my_ni_benchmark.test_stream))
      pattern_count = 0
      for batch_id, batch_info in enumerate(
          my_ni_benchmark.test_stream
      ):
          cur_test_set = batch_info.dataset
          t = batch_info.task_label
          self.assertEqual(0, t)
          self.assertEqual(batch_id, batch_info.current_experience)
          pattern_count += len(cur_test_set)
      self.assertEqual(len(mnist_test), pattern_count)
  
file_path: avalanche/tests/benchmarks/scenarios/deprecated/test_ni_sit_scenario.py
imports: import unittest
  import torch
  from torchvision.datasets import MNIST
  from avalanche.benchmarks import ni_benchmark
  from avalanche.benchmarks.datasets import default_dataset_location
  from avalanche.benchmarks.scenarios import NIExperience, ClassificationStream
  from avalanche.benchmarks.scenarios.deprecated.new_classes.nc_utils import make_nc_transformation_subset
  from avalanche.benchmarks.utils import _taskaware_classification_subset
label_desc: Use image node_id 1 for calling the NISITTests obj's underlying member method code with example usage: obj.test_ni_sit_single_dataset() without return types