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: Updates a pre-existing template and writes changes
  
  :param current_template_name: current name of the template stored in self.templates
  :param new_template_name: new name for the template
  :param jinja: new jinja entry
  :param reference: new reference entry
  :param metadata: a Metadata object with template annotations
  :param answer_choices: new answer_choices string
docstr_tok: ["Updates","a","pre-existing","template","and","writes","changes",":","param","current_template_name",":","current","name","of","the","template","stored","in","self.templates",":","param","new_template_name",":","new","name","for","the","template",":","param","jinja",":","new","jinja","entry",":","param","reference",":","new","reference","entry",":","param","metadata",":","a","Metadata","object","with","template","annotations",":","param","answer_choices",":","new","answer_choices","string"]
code: def update_template(
      self,
      current_template_name: str,
      new_template_name: str,
      jinja: str,
      reference: str,
      metadata: Template.Metadata,
      answer_choices: str,
  ) -> None:
      """
      Updates a pre-existing template and writes changes
  
      :param current_template_name: current name of the template stored in self.templates
      :param new_template_name: new name for the template
      :param jinja: new jinja entry
      :param reference: new reference entry
      :param metadata: a Metadata object with template annotations
      :param answer_choices: new answer_choices string
      """
      template_id = self.name_to_id_mapping[current_template_name]
      self.templates[template_id].name = new_template_name
      self.templates[template_id].jinja = jinja
      self.templates[template_id].reference = reference
      self.templates[template_id].metadata = metadata
      self.templates[template_id].answer_choices = answer_choices
  
      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 12 for calling the DatasetTemplates obj's underlying member method code with example usage: obj.update_template(current_template_name, new_template_name, jinja, reference, metadata, answer_choices) without return types