code: def Open(self):
          
          # Make sure we close any previous handle open to this usb device.
          port_path = tuple(self.port_path)
          with self._HANDLE_CACHE_LOCK:
              old_handle = self._HANDLE_CACHE.get(port_path)
              if old_handle is not None:
                  old_handle.Close()
  
          self._read_endpoint = None
          self._write_endpoint = None
  
          for endpoint in self._setting.iterEndpoints():
              address = endpoint.getAddress()
              if address & libusb1.USB_ENDPOINT_DIR_MASK:
                  self._read_endpoint = address
                  self._max_read_packet_len = endpoint.getMaxPacketSize()
              else:
                  self._write_endpoint = address
  
          assert self._read_endpoint is not None
          assert self._write_endpoint is not None
  
          handle = self._device.open()
          iface_number = self._setting.getNumber()
          try:
              if (platform.system() != 'Windows'
                      and handle.kernelDriverActive(iface_number)):
                  handle.detachKernelDriver(iface_number)
          except libusb1.USBError as e:
              if e.value == libusb1.LIBUSB_ERROR_NOT_FOUND:
                  _LOG.warning('Kernel driver not found for interface: %s.', iface_number)
              else:
                  raise
          handle.claimInterface(iface_number)
          self._handle = handle
          self._interface_number = iface_number
  
          with self._HANDLE_CACHE_LOCK:
              self._HANDLE_CACHE[port_path] = self
          # When this object is deleted, make sure it's closed.
          weakref.ref(self, self.Close)
docs: Opens the USB device for this setting, and claims the interface.