'Loading the dictionary that goes from indices to actual words'

def load_dict(self):

    if (self.indx_word and ('.pkl' in self.indx_word[(-4):])):
        data_dict = pkl.load(open(self.indx_word, 'r'))
        self.word_indxs = data_dict
        self.word_indxs[len(self.word_indxs.items())] = '<eol>'
        self.word_indxs[len(self.word_indxs.items())] = '<oov>'
    elif (self.indx_word and ('.np' in self.indx_word[(-4):])):
        self.word_indxs = numpy.load(self.indx_word)['unique_words']
    if (self.indx_word_src and ('.pkl' in self.indx_word_src[(-4):])):
        data_dict = pkl.load(open(self.indx_word_src, 'r'))
        self.word_indxs_src = data_dict
        self.word_indxs_src[len(self.word_indxs_src.items())] = '<eol>'
        self.word_indxs_src[len(self.word_indxs_src.items())] = '<oov>'
    elif (self.indx_word_src and ('.np' in self.indx_word_src[(-4):])):
        self.word_indxs_src = numpy.load(self.indx_word_src)['unique_words']
