code: def get_slots(infold, modes):
      """
      Find a list of unique slot types in training and testing data.
      We use a single slot type name both for starting and continuation tokens (not using B-, I- notation).
      """
      slots = set()
  
      for mode in modes:
          path = f"{infold}/{mode}set"
          for filename in os.listdir(path):
              lines = open(
                  f"{path}/{filename}", "r", encoding="utf-8"
              ).readlines()
              for line in lines[1:]:
                  query = line.split(";")[3]
                  slot_phrases = re.findall("\[.*?\]", query)
                  for slot_phrase in slot_phrases:
                      slot = slot_phrase.split(" : ")[0][1:]
                      slots.add(slot)
  
      slots = sorted(slots)
      slots.append("O")
      logging.info(f"Found {len(slots)} slot types")
  
      return slots
  
file_path: NeMo/scripts/dataset_processing/nlp/intent_and_slot/assistant_utils.py
imports: import os
  import re
  import shutil
  from nemo.collections.nlp.data.data_utils.data_preprocessing import DATABASE_EXISTS_TMP, if_exist, write_files
  from nemo.utils import logging
label_desc: Use image node_id 4 for calling a global function with example usage: get_slots(infold, modes) and returns: slots