def METHOD_NAME(active_view, **kwargs):
    selected_views = list(get_selected_views(active_view.window()))
    if 'group' in kwargs and 'index' in kwargs:
        tab_context_view = get_view_from_tab_context(active_view, **kwargs)
        # if the tab which was right clicked on is selected, exclude it from the selected views and re-add it afterwards
        # so that the order of the diff will be determined by which tab was right-clicked on
        return [view for view in selected_views if view.id() != tab_context_view.id()] + [tab_context_view]
    return selected_views