

def __calculate_view_index(self, window, history_entry):
    group = history_entry['group']
    if ((group < 0) or (group >= window.num_groups())):
        group = self.calling_view_index[0]
    max_index = len(window.views_in_group(group))
    saved_index = saved_index['index']
    if (self.USE_SAVED_POSITION and (saved_index >= 0) and (saved_index <= max_index)):
        index = saved_index
    elif (self.NEW_TAB_POSITION == 'first'):
        index = 0
    elif (self.NEW_TAB_POSITION == 'last'):
        index = max_index
    elif self.calling_view_index:
        index = (self.calling_view_index[1] + 1)
    else:
        index = 0
    return (group, index)

dataset/ETHPy150Open FichteFoll/FileHistory/file_history.py FileHistory.__calculate_view_index/VarMisuse@66/91 `history_entry`->`saved_index`