def load_wordvecs_from_binfile(word_vec_file,vocab=None):
    with open(word_vec_file, "rb") as f:
        word_vecs = {}
        header = f.readline()
        vocab_size, layer1_size = map(int, header.split())
        binary_len = np.dtype('float32').itemsize * layer1_size
        i = 0
        for line in xrange(vocab_size):
            word = []
            while True:
                ch = f.read(1)
                if ch == ' ':
                    word = ''.join(word)
                    break
                if ch != '\n':
                    word.append(ch)
            if vocab == None or word in vocab:
                word_vecs[word] = np.fromstring(f.read(binary_len), dtype='float32')
            else:
                f.read(binary_len)
        return word_vecs
Do iSCSI discovery on portal.
dataset/ETHPy150Open flipkart-incubator/optimus/cnn_text_trainer/rw/wordvecs.py/load_wordvecs_from_binfile--crossover with--dataset/ETHPy150Open openstack/ironic/ironic/drivers/modules/deploy_utils.py/discovery