<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def filter_embeddings(embeddings, vocab, dim):
 """Loads word vectors in numpy array. Args: embeddings (dict):
 a dictionary of numpy array. vocab (dict):
 word_index lookup table. Returns: numpy array: an array of word embeddings. """

    if not isinstance(embeddings, dict):
        return
    _embeddings = np.zeros([len(vocab), dim])
    for word in vocab:
        if word in embeddings:
            word_idx = vocab[word]
            _embeddings[word_idx] = embeddings[word]

    return _embeddings