code: def get_glove_matrix(vocabulary_list, download_path):
      """
      Function to obtain preprocessed glove embeddings matrix
      """
      save_file_name = download_path + sep + "glove.trimmed.300"
      if not os.path.exists(save_file_name + ".npz"):
          vocab_len = len(vocabulary_list)
          glove_path = os.path.join(
              download_path + sep + "glove.6B.300d.txt"
          )
          glove_matrix = np.zeros((vocab_len, 300))
          count = 0
          with open(glove_path) as f:
              for line in tqdm(f):
                  split_line = line.lstrip().rstrip().split(" ")
                  word = split_line[0]
                  word_vec = list(map(float, split_line[1:]))
                  if word in vocabulary_list:
                      word_index = vocabulary_list.index(word)
                      glove_matrix[word_index, :] = word_vec
                      count += 1
  
                  if word.upper() in vocabulary_list:
                      word_index = vocabulary_list.index(word.upper())
                      glove_matrix[word_index, :] = word_vec
                      count += 1
  
                  if word.capitalize() in vocabulary_list:
                      word_index = vocabulary_list.index(
                          word.capitalize()
                      )
                      glove_matrix[word_index, :] = word_vec
                      count += 1
  
          print("Saving the embeddings .npz file")
          np.savez_compressed(save_file_name, glove=glove_matrix)
          print(
              "Percentage of words in vocab found in glove embeddings %f"
              % (count / vocab_len)
          )
  
file_path: nlp-architect/examples/reading_comprehension/match_lstm_mrc/prepare_data.py
imports: from __future__ import print_function
  import numpy
  import argparse
  import json
  import os
  from tqdm import tqdm
  from nlp_architect.utils.io import validate_existing_directory
  from nlp_architect.utils.text import SpacyInstance
label_desc: Use image node_id 3 for calling a global function with example usage: get_glove_matrix(vocabulary_list, download_path) without return types