docs: def set_power(self, powerstate, wait=False):
          """Request power state change (helper)
  
          :param powerstate:
                              * on -- Request system turn on
                              * off -- Request system turn off without waiting
                                       for OS to shutdown
                              * shutdown -- Have system request OS proper
                                            shutdown
                              * reset -- Request system reset without waiting for
                                OS
                              * boot -- If system is off, then 'on', else 'reset'
          :param wait: If True, do not return until system actually completes
                       requested state change for 300 seconds.
                       If a non-zero number, adjust the wait time to the
                       requested number of seconds
          :raises: IpmiException on an error
          :returns: dict -- A dict describing the response retrieved
          """
          if powerstate not in power_states:
              raise exc.InvalidParameterValue(
                  "Unknown power state %s requested" % powerstate)
          newpowerstate = powerstate
          response = self.raw_command(netfn=0, command=1)
          if 'error' in response:
              raise exc.IpmiException(response['error'])
          oldpowerstate = 'on' if (response['data'][0] & 1) else 'off'
          if oldpowerstate == newpowerstate:
              return {'powerstate': oldpowerstate}
          if newpowerstate == 'boot':
              newpowerstate = 'on' if oldpowerstate == 'off' else 'reset'
          response = self.raw_command(
              netfn=0, command=2, data=[power_states[newpowerstate]])
          if 'error' in response:
              raise exc.IpmiException(response['error'])
          lastresponse = {'pendingpowerstate': newpowerstate}
          waitattempts = 300
          if not isinstance(wait, bool):
              waitattempts = wait
          if (wait and
             newpowerstate in ('on', 'off', 'shutdown', 'softoff')):
              if newpowerstate in ('softoff', 'shutdown'):
                  waitpowerstate = 'off'
              else:
                  waitpowerstate = newpowerstate
              currpowerstate = None
              while currpowerstate != waitpowerstate and waitattempts > 0:
                  response = self.raw_command(netfn=0, command=1, delay_xmit=1)
                  if 'error' in response:
                      raise exc.IpmiException(response['error'])
                  currpowerstate = 'on' if (response['data'][0] & 1) else 'off'
                  waitattempts -= 1
              if currpowerstate != waitpowerstate:
                  raise exc.IpmiException(
                      "System did not accomplish power state change")
              return {'powerstate': currpowerstate}
          else:
              return lastresponse