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","."]
docstr: Every template needs shortenable_ids, denoting which part of the template can be truncate to fit
  the language model's ``max_seq_length``. Default: the input text is shortenable, while the template text and other
  special tokens are not shortenable.
  
  e.g. when self.text is ``'{"placeholder": "text_a"} {"placeholder": "text_b", "shortenable": False} {"meta": "word"} is {"mask"}.'``,
  output is ``[1, 0, 0, 0, 0, 0, 0]``.
  
  Returns:
      :obj:`List[int]`: A list of integers in the range ``[0, 1]``:
  
      - 1 for the input tokens.
      - 0 for the template sequence tokens.
code: def get_default_shortenable_ids(self) -> List[int]:
      """Every template needs shortenable_ids, denoting which part of the template can be truncate to fit
      the language model's ``max_seq_length``. Default: the input text is shortenable, while the template text and other
      special tokens are not shortenable.
  
      e.g. when self.text is ``'{"placeholder": "text_a"} {"placeholder": "text_b", "shortenable": False} {"meta": "word"} is {"mask"}.'``,
      output is ``[1, 0, 0, 0, 0, 0, 0]``.
  
      Returns:
          :obj:`List[int]`: A list of integers in the range ``[0, 1]``:
  
          - 1 for the input tokens.
          - 0 for the template sequence tokens.
      """
      idx = []
      for d in self.text:
          if "shortenable" in d:
              idx.append(1 if d["shortenable"] else 0)
          else:
              idx.append(1 if "placeholder" in d else 0)
      return idx
  
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 3 for calling the Template obj's underlying member method code with example usage: obj.get_default_shortenable_ids() and returns: idx