code: def update_special_tokens_dict(
      cls,
      init_special_tokens_dict: Dict[str, str],
      mask_token: Optional[Union[str, bool]] = None,
      bos_token: Optional[Union[str, bool]] = None,
      eos_token: Optional[Union[str, bool]] = None,
      pad_token: Optional[Union[str, bool]] = None,
      sep_token: Optional[Union[str, bool]] = None,
      cls_token: Optional[Union[str, bool]] = None,
      unk_token: Optional[Union[str, bool]] = None,
  ):
      special_tokens_dict = init_special_tokens_dict.copy()
      for value, name in zip(
          [
              pad_token,
              unk_token,
              bos_token,
              eos_token,
              sep_token,
              mask_token,
              cls_token,
          ],
          [
              "pad_token",
              "unk_token",
              "bos_token",
              "eos_token",
              "sep_token",
              "mask_token",
              "cls_token",
          ],
      ):
          if value is not None:
              if isinstance(value, bool):
                  if value:
                      raise ValueError(
                          f"If `CharTokenizer` constructor parameter `{name}` is `bool` it has to be `False`"
                      )
                  else:
                      if name in special_tokens_dict:
                          del special_tokens_dict[name]
                      else:
                          warnings.warn(
                              f"Cannot remove special token `{name}` since it is not in special tokens dictionary "
                              f"{special_tokens_dict}."
                          )
              elif not isinstance(value, str):
                  raise ValueError(
                      f"`CharTokenizer` constructor parameter `{name}` has to be either `False` or belong to type "
                      f"`str`, whereas type of `{name}` is `{type(value)}`."
                  )
              else:
                  special_tokens_dict[name] = value
      cls.check_special_tokens_dict_for_duplicate_values(
          special_tokens_dict,
          "After updating special tokens dictionary with tokens passed in `CharTokenizer` constructor parameters",
      )
      return special_tokens_dict
  
imports: import json
  import os
  import warnings
  from collections import Counter
  from enum import Enum
  from pathlib import Path
  from typing import Dict, List, NewType, Optional, Union
  from nemo.collections.common.tokenizers.tokenizer_spec import TokenizerSpec
label_desc: Use image node_id 4 for calling the CharTokenizer obj's underlying member method code with example usage: obj.update_special_tokens_dict(cls, init_special_tokens_dict, mask_token, bos_token, eos_token, pad_token, sep_token, cls_token, unk_token) and returns: special_tokens_dict