code: def get_embedding_matrix(
      embeddings: dict,
      vocab: Vocabulary,
      embedding_size: int = None,
      lowercase_only: bool = False,
  ) -> np.ndarray:
      """
      Generate a matrix of word embeddings given a vocabulary
  
      Args:
          embeddings (dict): a dictionary of embedding vectors
          vocab (Vocabulary): a Vocabulary
          embedding_size (int): custom embedding matrix size
  
      Returns:
          a 2D numpy matrix of lexicon embeddings
      """
      emb_size = len(next(iter(embeddings.values())))
      if embedding_size:
          mat = np.zeros((embedding_size, emb_size))
      else:
          mat = np.zeros((len(vocab), emb_size))
      if lowercase_only:
          for word, wid in vocab.vocab.items():
              vec = embeddings.get(word.lower(), None)
              if vec is not None:
                  mat[wid] = vec
      else:
          for word, wid in vocab.vocab.items():
              vec = embeddings.get(word, None)
              if vec is None:
                  vec = embeddings.get(word.lower(), None)
              if vec is not None:
                  mat[wid] = vec
      return mat
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  import os
  import sys
  from typing import List
  import numpy
  from gensim.models import FastText
  from nlp_architect.utils.text import Vocabulary
label_desc: Use image node_id 3 for calling a global function with example usage: get_embedding_matrix(embeddings, vocab, embedding_size, lowercase_only) and returns: mat