code: def _get_subtokens_and_subtokens_mask(
      query: str, tokenizer: TokenizerSpec
  ) -> Tuple[List[str], List[bool]]:
      """
      Tokenizes input query into subtokens and creates subtokens mask. Subtokens mask is an array of the same length as
      subtokens array and contains zeros and ones in which. If element of mask equals 1, then corresponding subtoken in
      subtokens array is first subtoken in some word
      Args:
          query: a string that will be tokenized
          tokenizer: an instance of tokenizer
      Returns:
          subtokens: list of subtokens
          subtokens_mask: list of ints
      """
      words = query.strip().split()
      subtokens = []
      subtokens_mask = []
      for j, word in enumerate(words):
          word_tokens = tokenizer.text_to_tokens(word)
          subtokens.extend(word_tokens)
          subtokens_mask.append(True)
          subtokens_mask.extend([False] * (len(word_tokens) - 1))
      return subtokens, subtokens_mask
  
imports: import io
  import itertools
  from typing import Any, Dict, List, Optional, Tuple, Union
  import numpy
  import torch
  from numpy import ndarray
  from torch import Tensor
  from torch.nn.utils.rnn import pad_sequence
  from nemo.collections.common.tokenizers import TokenizerSpec
  from nemo.collections.nlp.data import get_stats
  from nemo.core import Dataset
  from nemo.core.neural_types import ChannelType, Index, MaskType, NeuralType
  from nemo.core.neural_types.elements import AudioSignal, BoolType, LengthsType
  from nemo.utils import logging
label_desc: Use image node_id 3 for calling a global function with example usage: _get_subtokens_and_subtokens_mask(query, tokenizer) and returns: subtokens,  subtokens_mask