def activate_next(self, cli, _previous=False):
        current = self.get_current_value(cli)
        options = sorted(self.values.keys())

        # Get current index.
        try:
            index = options.index(current)
        except ValueError:
            index = 0

        # Go to previous/next index.
        if _previous:
            index -= 1
        else:
            index += 1

        # Call handler for this option.
        next_option = options[index % len(options)]
        self.values[next_option](cli)
Picks a good scale for representing a number and formats it.
dataset/ETHPy150Open jonathanslenders/ptpython/ptpython/python_input.py/Option.activate_next--crossover with--dataset/ETHPy150Open Backblaze/B2_Command_Line_Tool/b2/utils.py/format_and_scale_number