code: def calc_vocab_load_stats(vocab, loaded_embed_dict):
      matching_count = len(
          set(vocab.ids_to_tokens) & set(loaded_embed_dict.keys())
      )
      missing_count = len(vocab) - matching_count
      percent_matching = matching_count / len(vocab) * 100
      return matching_count, missing_count, percent_matching
  
imports: import math
  import warnings
  import torch
  import torch.nn
  from torch.nn.utils import skip_init
  from onmt.modules.util_class import Elementwise
  from onmt.utils.logging import logger
label_desc: Use image node_id 2 for calling a global function with example usage: calc_vocab_load_stats(vocab, loaded_embed_dict) and returns: matching_count,  missing_count,  percent_matching