code: def test_filelist_benchmark(self):
      download_url(
          "https://storage.googleapis.com/mledu-datasets/"
          "cats_and_dogs_filtered.zip",
          expanduser("~") + "/.avalanche/data",
          "cats_and_dogs_filtered.zip",
      )
      archive_name = os.path.join(
          expanduser("~") + "/.avalanche/data",
          "cats_and_dogs_filtered.zip",
      )
      extract_archive(
          archive_name, to_path=expanduser("~") + "/.avalanche/data/"
      )
  
      dirpath = (
          expanduser("~")
          + "/.avalanche/data/cats_and_dogs_filtered/train"
      )
  
      with tempfile.TemporaryDirectory() as tmpdirname:
          list_paths = []
          for filelist, rel_dir, label in zip(
              ["train_filelist_00.txt", "train_filelist_01.txt"],
              ["cats", "dogs"],
              [0, 1],
          ):
              # First, obtain the list of files
              filenames_list = os.listdir(
                  os.path.join(dirpath, rel_dir)
              )
              filelist_path = os.path.join(tmpdirname, filelist)
              list_paths.append(filelist_path)
              with open(filelist_path, "w") as wf:
                  for name in filenames_list:
                      wf.write(
                          "{} {}\n".format(
                              os.path.join(rel_dir, name), label
                          )
                      )
  
          generic_benchmark = filelist_benchmark(
              dirpath,
              list_paths,
              [list_paths[0]],
              task_labels=[0, 0],
              complete_test_set_only=True,
              train_transform=ToTensor(),
              eval_transform=ToTensor(),
          )
  
      self.assertEqual(2, len(generic_benchmark.train_stream))
      self.assertEqual(1, len(generic_benchmark.test_stream))
  
imports: import os
  import tempfile
  import unittest
  from os.path import expanduser
  import torch
  from torchvision.datasets import MNIST
  from torchvision.datasets.utils import download_url, extract_archive
  from torchvision.transforms import ToTensor
  from tests.unit_tests_utils import DummyImageDataset
  from avalanche.benchmarks import dataset_benchmark, filelist_benchmark, tensors_benchmark, paths_benchmark, data_incremental_benchmark
  from avalanche.benchmarks.datasets import default_dataset_location
  from avalanche.benchmarks.scenarios.deprecated.generic_benchmark_creation import create_lazy_generic_benchmark, LazyStreamDefinition
  from avalanche.benchmarks.utils import _make_taskaware_classification_dataset, _make_taskaware_tensor_classification_dataset
  from tests.unit_tests_utils import common_setups
label_desc: Use image node_id 2 for calling the HighLevelGeneratorTests obj's underlying member method code with example usage: obj.test_filelist_benchmark() without return types