docstr: Whether the token is the first subword token in a list of subword tokens
  
  Parameters
  ----------
  tokens
      The input tokens
  
  Returns
  -------
  ret
      Whether the token is the first subword token in a sequence of subword tokens
      that construct the token
docstr_tok: ["Whether","the","token","is","the","first","subword","token","in","a","list","of","subword","tokens","Parameters","--","--","--","--","--","tokens","The","input","tokens","Returns","--","--","--","-","ret","Whether","the","token","is","the","first","subword","token","in","a","sequence","of","subword","tokens","that","construct","the","token"]
code: def is_first_subword(
      self, tokens: Union[str, int, List[str], List[int]]
  ) -> Union[bool, List[bool]]:
      """Whether the token is the first subword token in a list of subword tokens
  
      Parameters
      ----------
      tokens
          The input tokens
  
      Returns
      -------
      ret
          Whether the token is the first subword token in a sequence of subword tokens
          that construct the token
      """
      if isinstance(tokens, str):
          return tokens.startswith(self._meta_symbol)
      elif isinstance(tokens, int):
          return tokens in self._first_subword_id_set
      elif isinstance(tokens, list):
          if len(tokens) == 0:
              return []
          if isinstance(tokens[0], str):
              return [
                  ele.startswith(self._meta_symbol) for ele in tokens
              ]
          elif isinstance(tokens[0], int):
              return [
                  ele in self._first_subword_id_set for ele in tokens
              ]
          else:
              raise NotImplementedError
      else:
          raise NotImplementedError
  
file_path: gluon-nlp/src/gluonnlp/data/tokenizers/yttm.py
imports: from typing import Optional, Tuple, Union, List
  import os
  from .base import *
  from ..vocab import Vocab, load_vocab
  from ...utils.lazy_imports import try_import_yttm
label_desc: Use image node_id 5 for calling the YTTMTokenizer obj's underlying member method code with example usage: obj.is_first_subword(tokens) and returns: tokens, unknown, list, unknown, unknown