parameters: (cls, **kwargs: Any)
docstring: list pyusb devices for all available spectrometers
  
          Note: this includes spectrometers that are currently opened in other
          processes on the machine.
  
          Yields
          ------
          devices : USBTransportHandle
              unique pyusb devices for each available spectrometer
docstring_summary: list pyusb devices for all available spectrometers
docstring_tokens: list pyusb devices for all available spectrometers
function: def list_devices(cls, **kwargs: Any) -> Iterable[USBTransportHandle]:
          """list pyusb devices for all available spectrometers
  
          Note: this includes spectrometers that are currently opened in other
          processes on the machine.
  
          Yields
          ------
          devices : USBTransportHandle
              unique pyusb devices for each available spectrometer
          """
          # check if a specific pyusb backend is requested
          _pyusb_backend = kwargs.get("pyusb_backend", None)
          # get all matching devices
          try:
              pyusb_devices = usb.core.find(
                  find_all=True,
                  custom_match=lambda dev: (
                      dev.idVendor == cls.vendor_id and dev.idProduct in cls.product_ids
                  ),
                  backend=get_pyusb_backend_from_name(name=_pyusb_backend),
              )
          except usb.core.NoBackendError:
              raise RuntimeError("No pyusb backend found")
          # encapsulate
          for pyusb_device in pyusb_devices:
              yield USBTransportHandle(pyusb_device)
function_tokens: def list_devices ( cls , * * kwargs : Any ) -> Iterable [ USBTransportHandle ] : # check if a specific pyusb backend is requested _pyusb_backend = kwargs . get ( "pyusb_backend" , None ) # get all matching devices try : pyusb_devices = usb . core . find ( find_all = True , custom_match = lambda dev : ( dev . idVendor == cls . vendor_id and dev . idProduct in cls . product_ids ) , backend = get_pyusb_backend_from_name ( name = _pyusb_backend ) , ) except usb . core . NoBackendError : raise RuntimeError ( "No pyusb backend found" ) # encapsulate for pyusb_device in pyusb_devices : yield USBTransportHandle ( pyusb_device )