code: def shutdown(self, timeout=None, **kwargs):
          
          self._assert_transition('shutdown')
          self.trigger('pre_shutdown', **kwargs)
          self._execute_command(self.domain.shutdown)
          self._wait_for_shutdown(timeout)
          self.trigger('post_shutdown', **kwargs)
docs: Shuts down the Context. Sends an ACPI request to the OS for a clean
          shutdown.
  
          Triggered events::
            * pre_poweroff
            * post_poweroff
  
          .. note::
             The Guest OS needs to support ACPI requests sent from the host,
             the completion of the operation is not ensured by the platform.
             If the Guest OS is still running after the given timeout,
             a RuntimeError will be raised.
  
          @param timeout: (int) amout of seconds to wait for the machine shutdown.
          @param kwargs: keyword arguments to pass altogether with the events.