def __init__(self, id_vendor=0x0fcf, id_product=0x1008, ep=1):
        for dev in usb.core.find(idVendor=id_vendor, idProduct=id_product, find_all=True):
            try:
                dev.set_configuration()
                usb.util.claim_interface(dev, 0)
                self.dev = dev
                self.ep = ep
                break
            except __HOLE__ as (err, msg):
                if err == errno.EBUSY or "Device or resource busy" in msg: #libusb10 or libusb01
                    _log.info("Found device with vid(0x%04x) pid(0x%04x), but interface already claimed.", id_vendor, id_product)
                else:
                    raise
        else:
            raise NoUsbHardwareFound(errno.ENOENT, "No available device matching vid(0x%04x) pid(0x%04x)." % (id_vendor, id_product))
dataset/ETHPy150Open braiden/python-ant-downloader/antd/hw.py/UsbHardware.__init__