returns all the connected CMSIS-DAP devices
11556
def get_all_connected_interfaces():
        
        all_devices = hid.find_all_hid_devices()

        # find devices with good vid/pid
        all_mbed_devices = []
        for d in all_devices:
            if (d.product_name.find("CMSIS-DAP") >= 0):
                all_mbed_devices.append(d)

        boards = []
        for dev in all_mbed_devices:
            try:
                dev.open(shared=True)

                # Perform device-specific filtering.
                if filter_device_by_usage_page(dev.vendor_id, dev.product_id, dev.hid_caps.usage_page):
                    dev.close()
                    continue

                report = dev.find_output_reports()
                if len(report) != 1:
                    dev.close()
                    continue
                new_board = PyWinUSB()
                new_board.report = report[0]
                new_board.vendor_name = dev.vendor_name
                new_board.product_name = dev.product_name
                new_board.serial_number = dev.serial_number
                new_board.vid = dev.vendor_id
                new_board.pid = dev.product_id
                new_board.device = dev
                dev.close()
                boards.append(new_board)
            except Exception as e:
                if (str(e) != "Failure to get HID pre parsed data"):
                    log.error("Receiving Exception: %s", e)
                dev.close()

        return boards
960528
def devices(self):
        """"""
        if self._all_devices:
            return self._all_devices

        self._all_devices = {}
        self._all_devices['cameras'] = []
        self._all_devices['base_station'] = []

        url = DEVICES_ENDPOINT
        data = self.query(url)

        for device in data.get('data'):
            name = device.get('deviceName')
            if ((device.get('deviceType') == 'camera' or
                 device.get('deviceType') == 'arloq' or
                 device.get('deviceType') == 'arloqs') and
                    device.get('state') == 'provisioned'):
                camera = ArloCamera(name, device, self)
                self._all_devices['cameras'].append(camera)

            if (device.get('state') == 'provisioned' and
                    (device.get('deviceType') == 'basestation' or
                     device.get('modelId') == 'ABC1000')):
                base = ArloBaseStation(name, device, self.__token, self)
                self._all_devices['base_station'].append(base)

        return self._all_devices
255013
def sas_interconnects(self):
        
        if not self.__sas_interconnects:
            self.__sas_interconnects = SasInterconnects(self.__connection)
        return self.__sas_interconnects
1367782
def connecteds(self) -> Set[str]:
        
        return {r.name for r in self.remotes.values()
                if self.isRemoteConnected(r)}
805324
public Set<Integer> getAllDevices() {
        Set<Integer> all = new HashSet<>();
        all.addAll(activeDevices);
        all.addAll(inactiveDevices);
        return all;
    }
750605
def DbGetDeviceMemberList(self, argin):
        
        self._log.debug("In DbGetDeviceMemberList()")
        argin = replace_wildcard(argin)
        return self.db.get_device_member_list(argin)
296345
def trusted_devices(self):
        
        request = self.session.get(
            '%s/listDevices' % self._setup_endpoint,
            params=self.params
        )
        return request.json().get('devices')
566380
def devices():
    '''
    
    '''
    out = __salt__['cmd.run_all']("blkid -o export")
    salt.utils.fsutils._verify_run(out)

    return salt.utils.fsutils._blkid_output(out['stdout'], fs_type='btrfs')
1257469
def devices(self):
        
        devices = []
        count = self.lib.tdGetNumberOfDevices()
        for i in range(count):
            device = DeviceFactory(self.lib.tdGetDeviceId(i), lib=self.lib)
            devices.append(device)
        return devices
216874
def getAllConnectedInterface():
        

        devices = hid.enumerate()

        if not devices:
            logging.debug("No Mbed device connected")
            return []

        boards = []

        for deviceInfo in devices:
            product_name = deviceInfo['product_string']
            if (product_name.find("MicArray") < 0):
                # Skip non cmsis-dap devices
                continue

            try:
                dev = hid.device(vendor_id=deviceInfo['vendor_id'], product_id=deviceInfo['product_id'],
                    path=deviceInfo['path'])
            except IOError:
                logging.debug("Failed to open Mbed device")
                continue

            # Create the USB interface object for this device.
            new_board = HidApiUSB()
            new_board.vendor_name = deviceInfo['manufacturer_string']
            new_board.product_name = deviceInfo['product_string']
            new_board.serial_number = deviceInfo['serial_number']
            new_board.vid = deviceInfo['vendor_id']
            new_board.pid = deviceInfo['product_id']
            new_board.device_info = deviceInfo
            new_board.device = dev
            try:
                dev.open_path(deviceInfo['path'])
            except AttributeError:
                pass
            except IOError:
                # Ignore failure to open a device by skipping the device.
                continue

            boards.append(new_board)

        return boards
955815
def find_all_hid_devices():
    ""
    #
    # From DDK documentation (finding and Opening HID collection):
    # After a user-mode application is loaded, it does the following sequence
    # of operations:
    #
    #   * Calls HidD_GetHidGuid to obtain the system-defined GUID for HIDClass
    #     devices.
    #
    #   * Calls SetupDiGetClassDevs to obtain a handle to an opaque device
    #     information set that describes the device interfaces supported by all
    #     the HID collections currently installed in the system. The
    #     application should specify DIGCF_PRESENT and DIGCF_INTERFACEDEVICE
    #     in the Flags parameter passed to SetupDiGetClassDevs.
    #
    #   * Calls SetupDiEnumDeviceInterfaces repeatedly to retrieve all the
    #     available interface information.
    #
    #   * Calls SetupDiGetDeviceInterfaceDetail to format interface information
    #     for each collection as a SP_INTERFACE_DEVICE_DETAIL_DATA structure.
    #     The device_path member of this structure contains the user-mode name
    #     that the application uses with the Win32 function CreateFile to
    #     obtain a file handle to a HID collection.
    #
    # get HID device class guid
    guid = winapi.GetHidGuid()

    # retrieve all the available interface information.
    results = []
    required_size = DWORD()

    info_data         = winapi.SP_DEVINFO_DATA()
    info_data.cb_size = sizeof(winapi.SP_DEVINFO_DATA)

    with winapi.DeviceInterfaceSetInfo(guid) as h_info:
        for interface_data in winapi.enum_device_interfaces(h_info, guid):
            device_path = winapi.get_device_path(h_info,
                    interface_data,
                    byref(info_data))

            parent_device = c_ulong()

            #get parent instance id (so we can discriminate on port)
            if setup_api.CM_Get_Parent(byref(parent_device),
                    info_data.dev_inst, 0) != 0: #CR_SUCCESS = 0
                parent_device.value = 0 #null

            #get unique instance id string
            required_size.value = 0
            winapi.SetupDiGetDeviceInstanceId(h_info, byref(info_data),
                    None, 0,
                    byref(required_size) )

            device_instance_id = create_unicode_buffer(required_size.value)
            if required_size.value > 0:
                winapi.SetupDiGetDeviceInstanceId(h_info, byref(info_data),
                        device_instance_id, required_size,
                        byref(required_size) )

                hid_device = HidDevice(device_path,
                        parent_device.value, device_instance_id.value )
            else:
                hid_device = HidDevice(device_path, parent_device.value )

            # add device to results, if not protected
            if hid_device.vendor_id:
                results.append(hid_device)
    return results
343452
def get_devices(self):
        
        def process_result(result):
            return [self.get_device(dev) for dev in result]

        return Command('get', [ROOT_DEVICES], process_result=process_result)
784971
def get_interfaces(self):
        """"""
        result = {}

        interfaces = junos_views.junos_iface_table(self.device)
        interfaces.get()
        interfaces_logical = junos_views.junos_logical_iface_table(self.device)
        interfaces_logical.get()

        # convert all the tuples to our pre-defined dict structure
        def _convert_to_dict(interfaces):
            # calling .items() here wont work.
            # The dictionary values will end up being tuples instead of dictionaries
            interfaces = dict(interfaces)
            for iface, iface_data in interfaces.items():
                result[iface] = {
                    "is_up": iface_data["is_up"],
                    # For physical interfaces <admin-status> will always be there, so just
                    # return the value interfaces[iface]['is_enabled']
                    # For logical interfaces if <iff-down> is present interface is disabled,
                    # otherwise interface is enabled
                    "is_enabled": (
                        True
                        if iface_data["is_enabled"] is None
                        else iface_data["is_enabled"]
                    ),
                    "description": (iface_data["description"] or ""),
                    "last_flapped": float((iface_data["last_flapped"] or -1)),
                    "mac_address": napalm.base.helpers.convert(
                        napalm.base.helpers.mac,
                        iface_data["mac_address"],
                        py23_compat.text_type(iface_data["mac_address"]),
                    ),
                    "speed": -1,
                    "mtu": 0,
                }
                # result[iface]['last_flapped'] = float(result[iface]['last_flapped'])

                match_mtu = re.search(r"(\w+)", str(iface_data["mtu"]) or "")
                mtu = napalm.base.helpers.convert(int, match_mtu.group(0), 0)
                result[iface]["mtu"] = mtu
                match = re.search(r"(\d+|[Aa]uto)(\w*)", iface_data["speed"] or "")
                if match and match.group(1).lower() == "auto":
                    match = re.search(
                        r"(\d+)(\w*)", iface_data["negotiated_speed"] or ""
                    )
                if match is None:
                    continue
                speed_value = napalm.base.helpers.convert(int, match.group(1), -1)
                if speed_value == -1:
                    continue
                speed_unit = match.group(2)
                if speed_unit.lower() == "gbps":
                    speed_value *= 1000
                result[iface]["speed"] = speed_value

            return result

        result = _convert_to_dict(interfaces)
        result.update(_convert_to_dict(interfaces_logical))
        return result
1169533
def devices():
    
    udids = [udid.strip() for udid in idevice('_id', '-l').splitlines() if udid.strip()]
    return {udid: idevice('name', '-u', udid).decode('utf-8').strip() for udid in udids}
796966
async function listDevices(showAll){
    // get all available serial ports
    const ports = (await _serialport.list()) || [];
    // just pass-through
    if (showAll){
        return ports;

    // filter by vendorIDs
    }else{
        return ports.filter(function(item){
            // 
            return knownVendorIDs.includes(item.vendorId && item.vendorId.toUpperCase());
        });
    }
}
262492
def devices(self):
        
        install_devices = self.install_devices
        if 'bootstrap-system-devices' in env.instance.config:
            devices = set(env.instance.config['bootstrap-system-devices'].split())
        else:
            devices = set(self.sysctl_devices)
            for sysctl_device in self.sysctl_devices:
                for install_device in install_devices:
                    if install_device.startswith(sysctl_device):
                        devices.remove(sysctl_device)
        return devices
1146969
@Override
	public List<WebcamDevice> getDevices() {
		synchronized (this) {
			List<String> stdout = CommanderUtil.execute(this.command);
			if (stdout.isEmpty() || stdout.get(0).toLowerCase().contains(MSG_COMMAND_NOT_FOUND)) {
				throw new UnsupportedOperationException(MSG_RASPI_NOT_INSTALLED);
			}

			stdout = CommanderUtil.execute(COMMAND_VCGENCMD);
			if (stdout.size() != 1) {
				return Collections.emptyList();
			}
			String cameraCheckOutput = stdout.get(0).trim();
			int supported = Integer.parseInt(
					cameraCheckOutput.substring(cameraCheckOutput.indexOf("=") + 1, cameraCheckOutput.indexOf(" ")));
			if (supported == 0) {
				if (LOGGER.isDebugEnabled()) {
					LOGGER.debug(MSG_HARDWARE_NOT_FOUND);
				}
				return Collections.emptyList();
			}
			int detected = Integer.parseInt(cameraCheckOutput.substring(cameraCheckOutput.lastIndexOf("=") + 1));
			List<WebcamDevice> devices = new ArrayList<>(detected);
			for (int i = 0; i < detected; i++) {
				WebcamDevice device = createIPCDevice(i, new LinkedHashMap<String, String>(arguments));
				devices.add(device);
			}
			deviceCalled = true;
			return devices;
		}
	}