gets the named device.
        :param id: the id.
        :return: the device
171632
def getDevice(self, id):
        
        return next(iter([d for d in self.devices.values() if d.deviceId == id]), None)
1169139
def get_resource(self, device_id, resource_path):
        
        resources = self.list_resources(device_id)
        for r in resources:
            if r.path == resource_path:
                return r
        raise CloudApiException("Resource not found")
1319543
def get_item_with_id(self, uid):
        
        for item in self.get_items():
            if item.id == uid:
                return item

        return None
1140860
def get(self, id):
        
        url = self._url('%s' % (id))
        return self.client.get(url)
236139
def get_device(self, device_id, refresh=False):
        """"""
        if self._devices is None:
            self.get_devices()
            refresh = False

        device = self._devices.get(device_id)

        if device and refresh:
            device.refresh()

        return device
211411
def async_get_device(self, uid, fields='*'):
        """"""
        return (yield from self._get('/pods/{}'.format(uid),
                                     fields=fields))
678599
def devices(self):
        
        data = self.query(MyPlexDevice.key)
        return [MyPlexDevice(self, elem) for elem in data]
761666
public static function getDeviceById($id)
    {
        $device = static::lookupDevice('id', $id);
        if (!empty($device) && isset($device['class_name'])) {
            /** @var DeviceInterface $class */
            $class = $device['class_name'];
            $client = static::getClientByDevice($device);
            return new $class($id, $client);
        }

        // Search device in wemo link
        $bridge = new Bridge('wemo_link', new WemoClient($device['ip'], $device['port']));
        $devices = $bridge->getPairedDevices();

        foreach ($devices as $d) {
            if ($id === $d['id']) {
                if ($d['productName'] === 'Lighting') {
                    return new WemoBulb('wemo_link', $id);
                }
            }
        }

        throw new \Exception('Invalid device id supplied. No base device found by id ' . $id);
    }
258238
def id_request(self, device_id):
        """"""
        self.logger.info("\nid_request for device %s", device_id)
        device_id = device_id.upper()

        self.direct_command(device_id, '10', '00')

        sleep(2)

        status = self.get_buffer_status(device_id)
        if not status:
            sleep(1)
            status = self.get_buffer_status(device_id)

        return status
290205
def get(cls, device_id, custom_headers=None):
        

        if custom_headers is None:
            custom_headers = {}

        api_client = client.ApiClient(cls._get_api_context())
        endpoint_url = cls._ENDPOINT_URL_READ.format(device_id)
        response_raw = api_client.get(endpoint_url, {}, custom_headers)

        return BunqResponseDevice.cast_from_bunq_response(
            cls._from_json(response_raw)
        )
499324
def get_device_name(file_name, sys_obj_id, delimiter=":"):
    

    try:
        with open(file_name, "rb") as csv_file:
            csv_reader = csv.reader(csv_file, delimiter=delimiter)
            for row in csv_reader:
                if len(row) >= 2 and row[0] == sys_obj_id:
                    return row[1]
    except IOError:
        pass  # file does not exists

    return sys_obj_id
497118
def device(self):
		

		hdevice = self._libinput.libinput_event_get_device(self._hevent)
		return Device(hdevice, self._libinput)
405377
def _get_device_id(self, bus):
        
        _dbus = bus.get(SERVICE_BUS, PATH)
        devices = _dbus.devices()

        if self.device is None and self.device_id is None and len(devices) == 1:
            return devices[0]

        for id in devices:
            self._dev = bus.get(SERVICE_BUS, DEVICE_PATH + "/%s" % id)
            if self.device == self._dev.name:
                return id

        return None
756462
def devid(self):
        
        d = self.device
        vend_id = d.get('ID_VENDOR_ID')
        model_id = d.get('ID_MODEL_ID')
        return (vend_id, model_id)
787684
def name(self, id):
        
        data = self.bytes(id, 'N')
        if not data:
            print("%x has no name" % id)
            return
        if data[:1] == b'\x00':
            nameid, = struct.unpack_from(">" + self.fmt, data, 1)
            nameblob = self.blob(self.nodebase, 'S', nameid * 256, nameid * 256 + 32)
            return nameblob.rstrip(b"\x00").decode('utf-8')
        return data.rstrip(b"\x00").decode('utf-8')
1028698
def device_state(device_id):
    
    if device_id not in devices:
        return jsonify(success=False)
    return jsonify(state=devices[device_id].state)
648536
def get_xid_device(device_number):
    
    scanner = XidScanner()
    com = scanner.device_at_index(device_number)
    com.open()
    return XidDevice(com)