docstr: Whether the sub-token is the last sub-token in a split token list.
  
  Only supports the case when the tokenizer is a HuggingFaceBPETokenizer
  
  Parameters
  ----------
  tokens
      A single token or a list of tokens
  
  Returns
  -------
  ret
      The results
docstr_tok: ["Whether","the","sub-token","is","the","last","sub-token","in","a","split","token","list",".","Only","supports","the","case","when","the","tokenizer","is","a","HuggingFaceBPETokenizer","Parameters","--","--","--","--","--","tokens","A","single","token","or","a","list","of","tokens","Returns","--","--","--","-","ret","The","results"]
code: def is_last_subword(self, tokens):
      """Whether the sub-token is the last sub-token in a split token list.
  
      Only supports the case when the tokenizer is a HuggingFaceBPETokenizer
  
      Parameters
      ----------
      tokens
          A single token or a list of tokens
  
      Returns
      -------
      ret
          The results
      """
      assert (
          self.model_type == "BPEDecoder"
      ), "Only supports BPE model. The model_type={}".format(
          self.model_type
      )
      if isinstance(tokens, str):
          return tokens.endswith("</w>")
      elif isinstance(tokens, int):
          return tokens in self._last_subtoken_id_set
      elif isinstance(tokens, list):
          if len(tokens) == 0:
              return []
          if isinstance(tokens[0], str):
              return [ele.endswith("</w>") for ele in tokens], False
          elif isinstance(tokens[0], int):
              return [
                  ele in self._last_subtoken_id_set for ele in tokens
              ], False
          else:
              raise NotImplementedError
      else:
          raise NotImplementedError
  
imports: import os
  import json
  from pkg_resources import parse_version
  from typing import Optional, Union, List, Tuple
  from collections import OrderedDict
  from uuid import uuid4
  from .base import *
  from ..vocab import Vocab, load_vocab
  from ...utils.lazy_imports import try_import_huggingface_tokenizers
label_desc: Use image node_id 7 for calling the HuggingFaceTokenizer obj's underlying member method code with example usage: obj.is_last_subword(tokens) and returns: tokens, unknown, list, unknown,  False, unknown,  False