<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def send_feature_report(self, data, report_id=0x00):
 """ Send a Feature report to a HID device. Feature reports are sent over the Control endpoint as a Set_Report transfer. Parameters: data The data to send Returns: This function returns the actual number of bytes written """

        if not self._is_open:
            raise HIDException("HIDDevice not open")

        report = bytearray([report_id]) + bytearray(data)
        cdata = ffi.new("const unsigned char[]", bytes(report))
        bytes_written = hidapi.hid_send_feature_report(self._device, cdata, len(report))

        if bytes_written == -1:
            raise HIDException("Failed to send feature report to HID device")

        return bytes_written