class_docstr: Class that wraps all templates for a specific dataset/subset and implements all the helper
  functions necessary to read/write to the yaml file
class_docstr_tok: ["Class","that","wraps","all","templates","for","a","specific","dataset\/subset","and","implements","all","the","helper","functions","necessary","to","read\/write","to","the","yaml","file"]
docstr: Deletes a template
  
  :param template_name: name of template to remove
docstr_tok: ["Deletes","a","template",":","param","template_name",":","name","of","template","to","remove"]
code: def remove_template(self, template_name: str) -> None:
      """
      Deletes a template
  
      :param template_name: name of template to remove
      """
  
      # Even if we have an ID, we want to check for duplicate names
      if template_name not in self.all_template_names:
          raise ValueError(
              f"No template with name {template_name} for dataset {self.dataset_name} exists."
          )
  
      del self.templates[self.name_to_id_mapping[template_name]]
  
      if len(self.templates) == 0:
          # There is no remaining template, we can remove the entire folder
          self.delete_folder()
      else:
          # We just update the file
          self.write_to_file()
  
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 11 for calling the DatasetTemplates obj's underlying member method code with example usage: obj.remove_template(template_name) without return types