code: def calc_vocab_load_stats(vocab, loaded_embed_dict):
      matching_count = len(
          set(vocab.tokens_to_ids.values())
          & 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
  
file_path: OpenNMT-py/tools/embeddings_to_torch.py
imports: from __future__ import division
  import six
  import argparse
  import torch
  from onmt.utils.logging import init_logger, logger
  from onmt.inputters.inputter import dict_to_vocabs
label_desc: Use image node_id 4 for calling a global function with example usage: calc_vocab_load_stats(vocab, loaded_embed_dict) and returns: matching_count,  missing_count,  percent_matching