class_docstr: Endless Continual Leanring Simulator Dataset
class_docstr_tok: ["Endless","Continual","Leanring","Simulator","Dataset"]
code: def _load_metadata(self) -> bool:
      # If a 'named'-scenario has been selected
      if self.scenario is not None:
          # Get data name
          scenario_data_name = self._get_scenario_data()
          scenario_data_name = scenario_data_name[0].split(".")[0]
          # Check matching directory exists in endless_cl_sim_data
          match_path = None
          for data_name in endless_cl_sim_data.data:
              name = data_name[0].split(".")[0]
              # Omit non selected directories
              if str(scenario_data_name) == str(name):
                  # Check there is such a directory
                  if (self.root / name).exists():
                      if match_path is not None:
                          raise ValueError(
                              "Two directories match the selected scenario!"
                          )
                      match_path = str(self.root / name)
  
          if match_path is None:
              return False
  
          if not self.semseg:
              is_subsequence_preparation_done = (
                  self._prepare_classification_subsequence_datasets(
                      match_path
                  )
              )
          else:
              is_subsequence_preparation_done = (
                  self._prepare_video_subsequence_datasets(match_path)
              )
  
          if is_subsequence_preparation_done and self.verbose:
              print("Data is loaded..")
          else:
              return False
          return True
  
      # If a 'generic'-endless-cl-sim-scenario has been selected
      if not self.semseg:
          is_subsequence_preparation_done = (
              self._prepare_classification_subsequence_datasets(
                  str(self.root)
              )
          )
      else:
          is_subsequence_preparation_done = (
              self._prepare_video_subsequence_datasets(str(self.root))
          )
  
      if is_subsequence_preparation_done and self.verbose:
          print("Data is loaded...")
      else:
          return False
  
      # Finally
      return True
  
imports: from pathlib import Path
  import glob
  import os
  from typing import List, Optional, Union
  from warnings import warn
  import sys
  import json
  import numpy
  from PIL import Image
  from torch.utils.data import Dataset
  from avalanche.benchmarks.datasets import default_dataset_location
  from avalanche.benchmarks.datasets.endless_cl_sim import endless_cl_sim_data
  from avalanche.benchmarks.datasets.downloadable_dataset import DownloadableDataset
label_desc: Use image node_id 9 for calling the EndlessCLSimDataset obj's underlying member method code with example usage: obj._load_metadata() and returns: True, True, False, False, False