class_docstr: Construct a CANINE tokenizer (i.e. a character splitter). It turns text into a sequence of characters, and then
  converts each character into its Unicode code point.
  
  [`CanineTokenizer`] inherits from [`PreTrainedTokenizer`].
  
  Refer to superclass [`PreTrainedTokenizer`] for usage examples and documentation concerning parameters.
  
  Args:
      model_max_length (`int`, *optional*, defaults to 2048):
              The maximum sentence length the model accepts.
class_docstr_tok: ["Construct","a","CANINE","tokenizer","(","i.e",".","a","character","splitter",")",".","It","turns","text","into","a","sequence","of","characters",",","and","then","converts","each","character","into","its","Unicode","code","point",".","[","`","CanineTokenizer","`","]","inherits","from","[","`","PreTrainedTokenizer","`","]",".","Refer","to","superclass","[","`","PreTrainedTokenizer","`","]","for","usage","examples","and","documentation","concerning","parameters",".","Args",":","model_max_length","(","`","int","`",",","*","optional","*",",","defaults","to","2048",")",":","The","maximum","sentence","length","the","model","accepts","."]
docstr: Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
  special tokens using the tokenizer `prepare_for_model` method.
  
  Args:
      token_ids_0 (`List[int]`):
          List of IDs.
      token_ids_1 (`List[int]`, *optional*):
          Optional second list of IDs for sequence pairs.
      already_has_special_tokens (`bool`, *optional*, defaults to `False`):
          Whether or not the token list is already formatted with special tokens for the model.
  
  Returns:
      `List[int]`: A list of integers in the range [0, 1]: 1 for a special token, 0 for a sequence token.
docstr_tok: ["Retrieve","sequence","ids","from","a","token","list","that","has","no","special","tokens","added",".","This","method","is","called","when","adding","special","tokens","using","the","tokenizer","`","prepare_for_model","`","method",".","Args",":","token_ids_0","(","`","List","[","int","]","`",")",":","List","of","IDs",".","token_ids_1","(","`","List","[","int","]","`",",","*","optional","*",")",":","Optional","second","list","of","IDs","for","sequence","pairs",".","already_has_special_tokens","(","`","bool","`",",","*","optional","*",",","defaults","to","`","False","`",")",":","Whether","or","not","the","token","list","is","already","formatted","with","special","tokens","for","the","model",".","Returns",":","`","List","[","int","]","`",":","A","list","of","integers","in","the","range","[","0",",","1","]",":","1","for","a","special","token",",","0","for","a","sequence","token","."]
code: def get_special_tokens_mask(
      self,
      token_ids_0: List[int],
      token_ids_1: Optional[List[int]] = None,
      already_has_special_tokens: bool = False,
  ) -> List[int]:
      """
      Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
      special tokens using the tokenizer `prepare_for_model` method.
  
      Args:
          token_ids_0 (`List[int]`):
              List of IDs.
          token_ids_1 (`List[int]`, *optional*):
              Optional second list of IDs for sequence pairs.
          already_has_special_tokens (`bool`, *optional*, defaults to `False`):
              Whether or not the token list is already formatted with special tokens for the model.
  
      Returns:
          `List[int]`: A list of integers in the range [0, 1]: 1 for a special token, 0 for a sequence token.
      """
      if already_has_special_tokens:
          return super().get_special_tokens_mask(
              token_ids_0=token_ids_0,
              token_ids_1=token_ids_1,
              already_has_special_tokens=True,
          )
  
      result = [1] + ([0] * len(token_ids_0)) + [1]
      if token_ids_1 is not None:
          result += ([0] * len(token_ids_1)) + [1]
      return result
  
file_path: H2O/h2o_flexgen/benchmark/third_party/transformers/src/transformers/models/canine/tokenization_canine.py
imports: from typing import Dict, List, Optional
  from ...tokenization_utils import AddedToken, PreTrainedTokenizer
  from ...utils import logging
label_desc: Use image node_id 8 for calling the CanineTokenizer obj's underlying member method code with example usage: obj.get_special_tokens_mask(token_ids_0, token_ids_1, already_has_special_tokens) and returns: result, super