def prune_word_vectors(wv: dict, vocab: set):
    """
    Remove vectors of the words which does not appear in vocab

    Args:
        wv: word vectors, mapping from a string to an array of floats
        vocab: set of words

    Returns:
        Word vectors pruned from wv
    """
    # Extend the vocab to set of all lowercase-words
    exp_vocab = vocab.union({w.lower() for w in vocab})
    # The final vocabulary is the intersection between vocab accumulated from SQuAD data and all GLoVe words
    for w in list(wv.keys()):
        if w not in exp_vocab and w.lower() not in exp_vocab:
            del wv[w]
    return wv