def _retry_usb_function(count, func, *args, **kwargs):
  helper = timeouts.RetryHelper(count)
  while True:
    try:
      return func(*args, **kwargs)
    except usb_exceptions.CommonUsbError:
      if not helper.RetryIfPossible():
        raise
      time.sleep(0.1)
    else:
      break
Helper function to retry USB.
dataset/ETHPy150Open google/openhtf/openhtf/plugs/usb/fastboot_device.py/_retry_usb_function