def run(self, group=-1, index=-1):
        """Rename the given tab."""

        if group >= 0 and index >= 0:
            view = get_group_view(self.window, group, index)
            if view is not None:
                file_name = view.file_name()
                if file_name is not None and exists(file_name):
                    v = self.window.show_input_panel(
                        "Duplicate:", file_name,
                        lambda x: self.on_done(file_name, x),
                        None, None
                    )
                    file_path_len = len(file_name)
                    file_name_len = len(basename(file_name))
                    v.sel().clear()
                    v.sel().add(
                        sublime.Region(
                            file_path_len - file_name_len,
                            file_path_len
                        )
                    )
dataset/ETHPy150Open facelessuser/TabsExtra/tabs_extra.py/TabsExtraDuplicateCommand.run/original