code: def get_token_type(
      tokens: Union[
          List[str], List[int], List[List[str]], List[List[int]]
      ]
  ) -> type:
      """
  
      Parameters
      ----------
      tokens
          The input tokens.
  
      Returns
      -------
      token_type
          If the tokens is empty, return `str`.
          Otherwise, return `str` if the input is str and `int` if the input is int.
      """
      if len(tokens) == 0:
          return str
      if isinstance(tokens[0], int):
          return int
      elif isinstance(tokens[0], str):
          return str
      elif isinstance(tokens[0], list):
          flatten_tokens_it = itertools.chain.from_iterable(tokens)
          try:
              first_token = next(flatten_tokens_it)
              return type(first_token)
          except StopIteration:
              return str
      else:
          raise TokenTypeNotSupportedError(type(tokens[0]))
  
imports: import abc
  import itertools
  from ..vocab import Vocab
  from ...utils.registry import Registry
  from typing import List, Tuple, Union, NewType, Optional
label_desc: Use image node_id 2 for calling a global function with example usage: get_token_type(tokens) and returns: str, int, str, type, str