<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def loop_through_editors(self, backward=False):
 """ Loops through the editor tabs. :param backward: Looping backward. :type backward: bool :return: Method success. :rtype: bool """


        step = not backward and 1 or -1
        idx = self.Script_Editor_tabWidget.currentIndex() + step
        if idx < 0:
            idx = self.Script_Editor_tabWidget.count() - 1
        elif idx > self.Script_Editor_tabWidget.count() - 1:
            idx = 0
        self.Script_Editor_tabWidget.setCurrentIndex(idx)
        return True