def set_command(self, command):
        assert isinstance(command, cmd_base.ViCommandDefBase), \
            'ViCommandDefBase expected, got {0}'.format(type(command))

        if isinstance(command, cmd_base.ViMotionDef):
            if self.runnable():
                # We already have a motion, so this looks like an error.
                raise ValueError('too many motions')
            self.motion = command

            if self.mode == modes.OPERATOR_PENDING:
                self.mode = modes.NORMAL

            if self._set_parsers(command):
                return

        elif isinstance(command, cmd_base.ViOperatorDef):
            if self.runnable():
                # We already have an action, so this looks like an error.
                raise ValueError('too many actions')
            self.action = command

            if (self.action.motion_required and
                not self.in_any_visual_mode()):
                    self.mode = modes.OPERATOR_PENDING

            if self._set_parsers(command):
                return

        else:
            self.logger.info("[State] command: {0}".format(command))
            raise ValueError('unexpected command type')
Sets the current command to @command.
dataset/ETHPy150Open guillermooo/Vintageous/state.py/State.set_command