code: def open(self, usb_args):
          
          self.device = usb.core.find(**usb_args)
          if self.device is None:
              raise USBNotFoundError("Device not found or cable not plugged in.")
  
          self.idVendor = self.device.idVendor
          self.idProduct = self.device.idProduct
  
          check_driver = None
  
          try:
              check_driver = self.device.is_kernel_driver_active(0)
          except NotImplementedError:
              pass
  
          if check_driver is None or check_driver:
              try:
                  self.device.detach_kernel_driver(0)
              except usb.core.USBError as e:
                  if check_driver is not None:
                      print("Could not detatch kernel driver: {0}".format(str(e)))
  
          try:
              self.device.set_configuration()
              self.device.reset()
          except usb.core.USBError as e:
              print("Could not set configuration: {0}".format(str(e)))
docs: Search device on USB tree and set it as escpos device.
  
          :param usb_args: USB arguments