code: def count_tokens(data, unk_id=None):
      """Count tokens and oovs in token ID sequences.
  
      Args:
          data (list[np.ndarray]): list of token ID sequences
          unk_id (int): ID of unknown token
  
      Returns:
          tuple: tuple of number of token occurrences and number of oov tokens
  
      """
  
      n_tokens = 0
      n_oovs = 0
      for sentence in data:
          n_tokens += len(sentence)
          if unk_id is not None:
              n_oovs += np.count_nonzero(sentence == unk_id)
      return n_tokens, n_oovs
  
imports: import logging
  import os
  import random
  import chainer
  import h5py
  import numpy
  from chainer.training import extension
  from tqdm import tqdm
label_desc: Use image node_id 3 for calling a global function with example usage: count_tokens(data, unk_id) and returns: n_tokens,  n_oovs