code: def read_embeddings(file_enc, skip_lines=0, filter_set=None):
      embs = dict()
      total_vectors_in_file = 0
      with open(file_enc, "rb") as f:
          for i, line in enumerate(f):
              if i < skip_lines:
                  continue
              if not line:
                  break
              if len(line) == 0:
                  # is this reachable?
                  continue
  
              l_split = line.decode("utf8").strip().split(" ")
              if len(l_split) == 2:
                  continue
              total_vectors_in_file += 1
              if (
                  filter_set is not None
                  and l_split[0] not in filter_set
              ):
                  continue
              embs[l_split[0]] = [float(em) for em in l_split[1:]]
      return embs, total_vectors_in_file
  
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 2 for calling a global function with example usage: read_embeddings(file_enc, skip_lines, filter_set) and returns: embs,  total_vectors_in_file