code: def _decode_transfer_data(self, data):
          
          assert self.get_empty() is False
          if data[0] != Command.DAP_TRANSFER:
              raise ValueError('DAP_TRANSFER response error')
  
          if data[2] != DAP_TRANSFER_OK:
              if data[2] == DAP_TRANSFER_FAULT:
                  raise DAPAccessIntf.TransferFaultError()
              elif data[2] == DAP_TRANSFER_WAIT:
                  raise DAPAccessIntf.TransferTimeoutError()
              raise DAPAccessIntf.TransferError()
  
          # Check for count mismatch after checking for DAP_TRANSFER_FAULT
          # This allows TransferFaultError or TransferTimeoutError to get
          # thrown instead of TransferFaultError
          if data[1] != self._read_count + self._write_count:
              raise DAPAccessIntf.TransferError()
  
          return data[3:3 + 4 * self._read_count]
docs: Take a byte array and extract the data from it
  
          Decode the response returned by a DAP_Transfer CMSIS-DAP command
          and return it as an array of bytes.