def init(self, close_type, group, index):
        """
        Determine which views will be targeted by close command.

        Also determine which tab states need to be cleaned up.
        """

        self.persistent = is_persistent()
        self.sheets = self.window.sheets_in_group(int(group))
        assert(close_type in ["single", "left", "right", "other", "all"])

        # Setup active index and group
        active_sheet = self.window.active_sheet()
        active_index = None
        self.active_index = index
        self.active_group = None
        if active_sheet is not None:
            active_group, active_index = self.window.get_sheet_index(active_sheet)
            if group != active_group:
                active_index = None
        if active_index is not None:
            self.active_index = active_index

        # Compile a list of existing tabs with their timestamps
        self.last_activated = []
        if get_fallback_direction() == LAST:
            for s in self.sheets:
                if SHEET_WORKAROUND:
                    self.window.focus_sheet(s)
                    v = self.window.active_view()
                else:
                    v = s.view()
                if v is not None:
                    last_activated = v.settings().get("tabs_extra_last_activated", None)
                    if last_activated is not None:
                        self.last_activated.append((last_activated, s))
                else:
                    self.last_activated.append((0, s))

        # Determine targeted sheets to close and sheets to cleanup
        if close_type == "single":
            self.targets = [self.sheets[index]]
            self.cleanup = bool(len(self.sheets[:index] + self.sheets[index + 1:]))
        elif close_type == "left":
            self.targets = self.sheets[:index]
            self.cleanup = bool(len(self.sheets[index:]))
        elif close_type == "right":
            self.targets = self.sheets[index + 1:]
            self.cleanup = bool(len(self.sheets[:index + 1]))
        elif close_type == "other":
            self.targets = self.sheets[:index] + self.sheets[index + 1:]
            self.cleanup = True
        elif close_type == "all":
            self.targets = self.sheets[:]
            self.cleanup = False
dataset/ETHPy150Open facelessuser/TabsExtra/tabs_extra.py/TabsExtraCloseCommand.init/original