class_docstr: Base class for all the templates.
  Most of methods are abstract, with some exceptions to hold the common methods for all template, such as ``loss_ids``, ``save``, ``load``.
  
  Args:
      tokenizer (:obj:`PreTrainedTokenizer`): A tokenizer to appoint the vocabulary and the tokenization strategy.
      placeholder_mapping (:obj:`dict`): A place holder to represent the original input text.
class_docstr_tok: ["Base","class","for","all","the","templates",".","Most","of","methods","are","abstract",",","with","some","exceptions","to","hold","the","common","methods","for","all","template",",","such","as","``","loss_ids","``",",","``","save","``",",","``","load","``",".","Args",":","tokenizer","(",":","obj",":","`","PreTrainedTokenizer","`",")",":","A","tokenizer","to","appoint","the","vocabulary","and","the","tokenization","strategy",".","placeholder_mapping","(",":","obj",":","`","dict","`",")",":","A","place","holder","to","represent","the","original","input","text","."]
code: def parse_text(self, text: str) -> List[Dict]:
      parsed = []
      i = 0
      while i < len(text):
          d = {
              "add_prefix_space": " "
              if (i > 0 and text[i - 1] == " ")
              else ""
          }
          while i < len(text) and text[i] == " ":
              d["add_prefix_space"] = " "
              i = i + 1
          if i == len(text):
              break
  
          if text[i] != self.mixed_token_start:
              j = i + 1
              while j < len(text):
                  if text[j] == self.mixed_token_start:
                      break
                  j = j + 1
              d["text"] = text[i:j].rstrip(" ")
              i = j
  
          else:
              j = i + 1
              mixed_token_cnt = 1  # { {} {} } nested support
              while j < len(text):
                  if text[j] == self.mixed_token_end:
                      mixed_token_cnt -= 1
                      if mixed_token_cnt == 0:
                          break
                  elif text[j] == self.mixed_token_start:
                      mixed_token_cnt += 1
                  j = j + 1
              if j == len(text):
                  raise ValueError(
                      f"mixed_token_start {self.mixed_token_start} at position {i} has no corresponding mixed_token_end {self.mixed_token_end}"
                  )
              dict_str = "{" + text[i + 1 : j] + "}"
              try:
                  val = eval(dict_str)
                  if isinstance(val, set):
                      val = {k: None for k in val}
                  d.update(val)
              except:
                  import traceback
  
                  print(traceback.format_exc())
                  print(f"syntax error in {dict_str}")
                  exit()
              i = j + 1
  
          parsed.append(d)
  
      return parsed
  
imports: from abc import abstractmethod
  import json
  from transformers.file_utils import ModelOutput
  from openprompt.config import convert_cfg_to_dict
  from transformers.utils.dummy_pt_objects import PreTrainedModel
  from openprompt.utils.utils import signature
  from yacs.config import CfgNode
  from openprompt.data_utils import InputFeatures, InputExample
  import torch
  import torch.nn
  from typing import *
  from transformers.tokenization_utils import PreTrainedTokenizer
  from openprompt.utils.logging import logger
  import numpy
  import torch.nn.functional
label_desc: Use image node_id 7 for calling the Template obj's underlying member method code with example usage: obj.parse_text(text) and returns: parsed