class_docstr: CLEAR Base Dataset for downloading / loading metadata
docstr: Load Metadata for clear10_neurips2021 and clear100_cvpr2022
docstr_tok: ["Load","Metadata","for","clear10_neurips2021","and","clear100_cvpr2022"]
code: def _load_metadata_old(self) -> bool:
      """
      Load Metadata for clear10_neurips2021 and clear100_cvpr2022
      """
      train_folder_path = self.root / "training_folder"
      if not train_folder_path.exists():
          print(f"{train_folder_path} does not exist. ")
          return False
  
      self.bucket_indices = _load_json(
          train_folder_path / "bucket_indices.json"
      )
  
      class_names_file = self.root / "class_names.txt"
      self.class_names = class_names_file.read_text().split("\n")
  
      filelist_folder_path = train_folder_path / "filelists"
  
      filelist_name = f"all.txt"
  
      filelists = []
      for bucket_index in self.bucket_indices:
          f_path = (
              filelist_folder_path / str(bucket_index) / filelist_name
          )
          try:
              filelists.append(default_flist_reader(f_path))
          except Exception as e:
              print(f"Error reading {f_path}")
              return False
  
      self.samples = []
      for f_list in filelists:
          self.samples += f_list
  
      # Check whether all labeled images exist
      for img_path, _ in self.samples:
          path = self.root / img_path
          if not os.path.exists(path):
              print(
                  f"{path} does not exist. Files not properly extracted?"
              )
              return False
      return True
  
imports: from pathlib import Path
  from typing import Optional, Sequence, Tuple, Union, List
  import json
  import os
  import torch
  from torchvision.datasets.folder import default_loader
  from avalanche.benchmarks.datasets import DownloadableDataset, default_dataset_location
  from avalanche.benchmarks.utils import default_flist_reader
  from avalanche.benchmarks.datasets.clear import clear_data
label_desc: Use image node_id 4 for calling the CLEARDataset obj's underlying member method code with example usage: obj._load_metadata_old() and returns: True, False, False, False