def run_cmd(self, util, mode, direction=1):
        # This works first by finding the bounds of the operation by executing a forward-word
        # command. Then it performs the case command.
        view = self.view
        count = util.get_count(True)

        # copy the cursors
        selection = view.sel()
        regions = list(selection)

        # If the regions are all empty, we just move from where we are to where we're going. If
        # there are regions, we use the regions and just do the cap, lower, upper within that
        # region. That's different from Emacs but I think this is better than emacs.
        empty = util.all_empty_regions(regions)

        if empty:
            # run the move-word command so we can create a region
            direction = -1 if count < 0 else 1
            util.run_command("sbp_move_word", {"direction": 1})

            # now the selection is at the "other end" and so we create regions out of all the
            # cursors
            new_regions = []
            for r, s in zip(regions, selection):
                new_regions.append(r.cover(s))
            selection.clear()
            selection.add_all(new_regions)

        # perform the operation
        if ('upper', 'lower') in mode:
            util.run_command(mode + "_case", {})
        else:
            for r in selection:
                util.view.replace(util.edit, r, view.substr(r).title())

        if empty:
            if count < 0:
                # restore cursors to original state if direction was backward
                selection.clear()
                selection.add_all(regions)
            else:
                # otherwise we leave the cursors at the end of the regions
                for r in new_regions:
                    r.a = r.b = r.end()
                selection.clear()
                selection.add_all(new_regions)
dataset/ETHPy150Open grundprinzip/sublemacspro/jove.py/SbpCaseWordCommand.run_cmd/swapped operands of `in`