code: def build_embedding(dictionary, embed_dim, path=None):
      num_embeddings = len(dictionary)
      padding_idx = dictionary.pad()
      emb = Embedding(num_embeddings, embed_dim, padding_idx)
      # if provided, load from preloaded dictionaries
      if path:
          embed_dict = utils.parse_embedding(path)
          utils.load_embedding(embed_dict, dictionary, emb)
      return emb
  
imports: import abc
  import math
  import torch
  import torch.nn
  import torch.nn.functional
  from fairseq import utils
  from fairseq.models import FairseqIncrementalDecoder, transformer
  from pytorch_translate import rnn_cell, utils, vocab_reduction
  from pytorch_translate.research.lexical_choice import lexical_translation
label_desc: Use image node_id 3 for calling a global function with example usage: build_embedding(dictionary, embed_dim, path) and returns: emb