def select_tab(self, window, group_id, last_index):
        """Select the desired fallback tab."""

        selected = False
        sheets = window.sheets_in_group(group_id)
        fallback_mode = get_fallback_direction()
        if len(sheets) == 0:
            return
        if last_index >= 0:
            if fallback_mode == LAST:
                selected = self.select_last(sheets, window, last_index)
            elif fallback_mode == RIGHT:
                selected = self.select_right(sheets, window, last_index)
            else:
                selected = self.select_left(sheets, window, last_index)
        return selected
dataset/ETHPy150Open facelessuser/TabsExtra/tabs_extra.py/TabsExtraListener.select_tab/original