code: def _bert_add_special_tokens(token_o):
      """
      Adds special tokens (CLS,SEP) which are often used by pre-trained BERT
      models to input_ids and adjusts attention_mask and metadata to account
      for them.
      """
      max_length = token_o["input_ids"].shape[1]
      seq_end_col = max_length - (
          token_o["input_ids"][:, ::-1] != 0
      ).argmax(1)
      # clipping to take overflow into account
      seq_end_col = cp.clip(
          seq_end_col + 1, a_min=None, a_max=max_length - 1
      )
  
      _bert_add_special_tokens_input_ids(
          token_o["input_ids"], seq_end_col
      )
      _bert_add_special_tokens_attention_mask(
          token_o["attention_mask"], seq_end_col
      )
      _bert_add_special_tokens_metadata(token_o["metadata"], max_length)
  
      return token_o
  
file_path: cudf/python/cudf/cudf/core/subword_tokenizer.py
imports: from __future__ import annotations
  import warnings
  from typing import Union
  import cupy
  from cudf._lib.nvtext.subword_tokenize import Hashed_Vocabulary, subword_tokenize_inmem_hash
label_desc: Use image node_id 2 for calling a global function with example usage: _bert_add_special_tokens(token_o) and returns: token_o