code: def _raw_write(self, data, debug_str = None):
          
          if self.debug:
              if not debug_str:
                  debug_str = ''
              hexdump = yubico_util.hexdump(data, colorize=True)[:-1] # strip LF
              self._debug("WRITE : %s %s\n" % (hexdump, debug_str))
          request_type = _USB_TYPE_CLASS | _USB_RECIP_INTERFACE | _USB_ENDPOINT_OUT
          value = _REPORT_TYPE_FEATURE << 8    # apparently required for YubiKey 1.3.2, but not 2.2.x
          sent = self._usb_handle.controlMsg(request_type,
                                            _HID_SET_REPORT,
                                            data,
                                            value = value,
                                            timeout = _USB_TIMEOUT_MS)
          if sent != _FEATURE_RPT_SIZE:
              self.debug("Failed writing %i bytes (wrote %i) to USB HID YubiKey.\n"
                         % (_FEATURE_RPT_SIZE, sent))
              raise YubiKeyUSBHIDError('Failed talking to USB HID YubiKey')
          return sent
docs: Write data to YubiKey.