code: def initialize_new_tokens(self, inserting_toks: List[str]):
      idx = 0
      for tokenizer, text_encoder in zip(
          self.tokenizers, self.text_encoders
      ):
          assert isinstance(
              inserting_toks, list
          ), "inserting_toks should be a list of strings."
          assert all(
              isinstance(tok, str) for tok in inserting_toks
          ), "All elements in inserting_toks should be strings."
  
          self.inserting_toks = inserting_toks
          special_tokens_dict = {
              "additional_special_tokens": self.inserting_toks
          }
          tokenizer.add_special_tokens(special_tokens_dict)
          text_encoder.resize_token_embeddings(len(tokenizer))
  
          self.train_ids = tokenizer.convert_tokens_to_ids(
              self.inserting_toks
          )
  
          # random initialization of new tokens
          std_token_embedding = (
              text_encoder.text_model.embeddings.token_embedding.weight.data.std()
          )
  
          print(
              f"{idx} text encodedr's std_token_embedding: {std_token_embedding}"
          )
  
          text_encoder.text_model.embeddings.token_embedding.weight.data[
              self.train_ids
          ] = (
              torch.randn(
                  len(self.train_ids),
                  text_encoder.text_model.config.hidden_size,
              )
              .to(device=self.device)
              .to(dtype=self.dtype)
              * std_token_embedding
          )
          self.embeddings_settings[
              f"original_embeddings_{idx}"
          ] = (
              text_encoder.text_model.embeddings.token_embedding.weight.data.clone()
          )
          self.embeddings_settings[
              f"std_token_embedding_{idx}"
          ] = std_token_embedding
  
          inu = torch.ones((len(tokenizer),), dtype=torch.bool)
          inu[self.train_ids] = False
  
          self.embeddings_settings[f"index_no_updates_{idx}"] = inu
  
          print(
              self.embeddings_settings[f"index_no_updates_{idx}"].shape
          )
  
          idx += 1
  
imports: import argparse
  import gc
  import hashlib
  import itertools
  import logging
  import math
  import os
  import re
  import shutil
  import warnings
  from pathlib import Path
  from typing import List, Optional
  import numpy
  import torch
  import torch.nn.functional
  import torch.utils.checkpoint
  import transformers
  from accelerate import Accelerator
  from accelerate.logging import get_logger
  from accelerate.utils import DistributedDataParallelKwargs, ProjectConfiguration, set_seed
  from huggingface_hub import create_repo, upload_folder
  from packaging import version
  from peft import LoraConfig, set_peft_model_state_dict
  from peft.utils import get_peft_model_state_dict
  from PIL import Image
  from PIL.ImageOps import exif_transpose
  from safetensors.torch import load_file, save_file
  from torch.utils.data import Dataset
  from torchvision import transforms
  from tqdm.auto import tqdm
  from transformers import AutoTokenizer, PretrainedConfig
  import diffusers
  from diffusers import AutoencoderKL, DDPMScheduler, DPMSolverMultistepScheduler, StableDiffusionXLPipeline, UNet2DConditionModel
  from diffusers.loaders import LoraLoaderMixin
  from diffusers.optimization import get_scheduler
  from diffusers.training_utils import _set_state_dict_into_text_encoder, cast_training_params, compute_snr
  from diffusers.utils import check_min_version, convert_all_state_dict_to_peft, convert_state_dict_to_diffusers, convert_state_dict_to_kohya, convert_unet_state_dict_to_peft, is_wandb_available
  from diffusers.utils.import_utils import is_xformers_available
  from diffusers.utils.torch_utils import is_compiled_module
label_desc: Use image node_id 2 for calling the TokenEmbeddingsHandler obj's underlying member method code with example usage: obj.initialize_new_tokens(inserting_toks) without return types