docstr: Whether the token is the last subword token. This can be used
  for whole-word masking.
  
  Parameters
  ----------
  tokens
      The input tokens
  
  Returns
  -------
  ret
      Whether the token is the last subword token in the list of subwords
docstr_tok: ["Whether","the","token","is","the","last","subword","token",".","This","can","be","used","for","whole-word","masking",".","Parameters","--","--","--","--","--","tokens","The","input","tokens","Returns","--","--","--","-","ret","Whether","the","token","is","the","last","subword","token","in","the","list","of","subwords"]
code: def is_last_subword(
      self, tokens: Union[str, int, List[str], List[int]]
  ) -> Union[bool, List[bool]]:
      """Whether the token is the last subword token. This can be used
      for whole-word masking.
  
      Parameters
      ----------
      tokens
          The input tokens
  
      Returns
      -------
      ret
          Whether the token is the last subword token in the list of subwords
      """
      if isinstance(tokens, str):
          return not tokens.endswith(self._separator)
      elif isinstance(tokens, int):
          return tokens in self._last_subword_id_set
      elif isinstance(tokens, list):
          if len(tokens) == 0:
              return []
          if isinstance(tokens[0], str):
              return [
                  not ele.endswith(self._separator) for ele in tokens
              ]
          elif isinstance(tokens[0], int):
              return [
                  ele in self._last_subword_id_set for ele in tokens
              ]
          else:
              raise NotImplementedError
      else:
          raise NotImplementedError
  
file_path: gluon-nlp/src/gluonnlp/data/tokenizers/subword_nmt.py
imports: import os
  from typing import Optional, Union, List
  from .base import TOKENIZER_REGISTRY, BaseTokenizerWithVocab, TokenizerEncodeWithoutVocabError, TokenizerDecodeWithoutVocabError, TokenTypeNotSupportedError, rebuild_offset_from_tokens, TokensType, TokenIDsType, TokenOffsetsType, SentencesType, is_tokens_from_multiple_sentences, get_token_type
  from ..vocab import Vocab, load_vocab
  from ...utils.lazy_imports import try_import_subword_nmt
label_desc: Use image node_id 6 for calling the SubwordNMTTokenizer obj's underlying member method code with example usage: obj.is_last_subword(tokens) and returns: unknown, unknown, list, unknown, unknown