class_docstr: This helper class wraps the DatasetTemplates class
  - Initialized the DatasetTemplates for all existing template folder
  - Give access to each DatasetTemplates
  - Provides aggregated counts over all DatasetTemplates
class_docstr_tok: ["This","helper","class","wraps","the","DatasetTemplates","class","-","Initialized","the","DatasetTemplates","for","all","existing","template","folder","-","Give","access","to","each","DatasetTemplates","-","Provides","aggregated","counts","over","all","DatasetTemplates"]
code: def _collect_dataset(self, dataset):
      output = (
          {}
      )  # format is {(dataset_name, subset_name): DatasetsTemplates}
      for filename in os.listdir(
          os.path.join(TEMPLATES_FOLDER_PATH, dataset)
      ):
          if filename.endswith(".yaml"):
              # If there is no sub-folder, there is no subset for this dataset
              output[(dataset, None)] = DatasetTemplates(dataset)
          else:
              # This is a subfolder, and its name corresponds to the subset name
              output[(dataset, filename)] = DatasetTemplates(
                  dataset_name=dataset, subset_name=filename
              )
      return output
  
imports: import logging
  import os
  import random
  import re
  import uuid
  from collections import Counter, defaultdict
  from shutil import rmtree
  from typing import Dict, List, Optional, Tuple
  import pandas
  import pkg_resources
  import yaml
  from jinja2 import BaseLoader, Environment, meta
  from ..constants import AUTOMM
label_desc: Use image node_id 6 for calling the TemplateCollection obj's underlying member method code with example usage: obj._collect_dataset(dataset) and returns: output