def get_descriptor(dev, desc_size, desc_type, desc_index, wIndex=0):
 wValue = (desc_index | (desc_type << 8))
 bmRequestType = util.build_request_type(util.CTRL_IN, util.CTRL_TYPE_STANDARD, util.CTRL_RECIPIENT_DEVICE)
 return dev.ctrl_transfer(bmRequestType=bmRequestType, bRequest=6, wValue=wValue, wIndex=wIndex, data_or_wLength=desc_size)

def get_descriptor ( dev , desc_size , desc_type , desc_index , wIndex = 0 ) : wValue = ( desc_index | ( desc_type << 8 ) ) bmRequestType = util . build_request_type ( util . CTRL_IN , util . CTRL_TYPE_STANDARD , util . CTRL_RECIPIENT_DEVICE ) return dev . ctrl_transfer ( bmRequestType = bmRequestType , bRequest = 6 , wValue = wValue , wIndex = wIndex , data_or_wLength = desc_size )
return the specified descriptor .