code: def __init__(self, path, **context):
      if not os.path.exists(path):
          raise Exception("template file does not exist.")
      self.path = path
      self.__add_mime_types()
      for root, _dirs, files in os.walk(path):
          for file in files:
              if any(file.endswith(name) for name in self.extname):
                  file_path = os.path.join(root, file)
                  rel_path = os.path.relpath(file_path, path).replace(
                      os.path.sep, "/"
                  )
                  with open(file_path, "r", encoding="UTF-8") as f:
                      content = f.read()
                      envs = self.defaults.copy()
                      envs.update(context)
                      for key, value in envs.items():
                          content = content.replace(
                              "{{" + key + "}}", value
                          )
                  self.__files[rel_path] = (
                      content,
                      mimetypes.guess_type(file)[0],
                  )
  
imports: import os
  import mimetypes
  from flask import Response, send_from_directory
label_desc: Use image node_id 1 to create a new Template object from inherited base classes: object with example: obj = Template(path)