<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _command(self, event, command, *args, **kwargs):
 """ Context state controller. Check whether the transition is possible or not, it executes it and triggers the Hooks with the pre_* and post_* events. @param event: (str) event generated by the command. @param command: (virDomain.method) state transition to impose. @raise: RuntimeError. """

        self._assert_transition(event)
        self.trigger('pre_%s' % event, **kwargs)
        self._execute_command(command, *args)
        self.trigger('post_%s' % event, **kwargs)