docs: def cancel_hardware(self, hardware_id, reason='unneeded', comment='', immediate=False):
          """Cancels the specified dedicated server.
  
          Example::
  
              # Cancels hardware id 1234
              result = mgr.cancel_hardware(hardware_id=1234)
  
          :param int hardware_id: The ID of the hardware to be cancelled.
          :param string reason: The reason code for the cancellation. This should come from
                                :func:`get_cancellation_reasons`.
          :param string comment: An optional comment to include with the cancellation.
          :param bool immediate: If set to True, will automatically update the cancelation ticket to request
                                 the resource be reclaimed asap. This request still has to be reviewed by a human
          :returns: True on success or an exception
          """
  
          # Get cancel reason
          reasons = self.get_cancellation_reasons()
          cancel_reason = reasons.get(reason, reasons['unneeded'])
          ticket_mgr = SoftLayer.TicketManager(self.client)
          mask = 'mask[id, hourlyBillingFlag, billingItem[id], openCancellationTicket[id], activeTransaction]'
          hw_billing = self.get_hardware(hardware_id, mask=mask)
  
          if 'activeTransaction' in hw_billing:
              raise SoftLayer.SoftLayerError("Unable to cancel hardware with running transaction")
  
          if 'billingItem' not in hw_billing:
              raise SoftLayer.SoftLayerError("Ticket #%s already exists for this server" %
                                             hw_billing['openCancellationTicket']['id'])
  
          billing_id = hw_billing['billingItem']['id']
  
          if immediate and not hw_billing['hourlyBillingFlag']:
              LOGGER.warning("Immediate cancelation of montly servers is not guaranteed."
                             "Please check the cancelation ticket for updates.")
  
              result = self.client.call('Billing_Item', 'cancelItem',
                                        False, False, cancel_reason, comment, id=billing_id)
              hw_billing = self.get_hardware(hardware_id, mask=mask)
              ticket_number = hw_billing['openCancellationTicket']['id']
              cancel_message = "Please reclaim this server ASAP, it is no longer needed. Thankyou."
              ticket_mgr.update_ticket(ticket_number, cancel_message)
              LOGGER.info("Cancelation ticket #%s has been updated requesting immediate reclaim", ticket_number)
          else:
              result = self.client.call('Billing_Item', 'cancelItem',
                                        immediate, False, cancel_reason, comment, id=billing_id)
              hw_billing = self.get_hardware(hardware_id, mask=mask)
              ticket_number = hw_billing['openCancellationTicket']['id']
              LOGGER.info("Cancelation ticket #%s has been created", ticket_number)
  
          return result