Return a Device object based on id

        :param device_id: id of device
        :type device_id: int
        :param args: extra parameters
        :param kwargs: extra parameters
        :returns: Device object
        :rtype: Device
501943
def device(self, device_id, *args, **kwargs):
        
        return Device(device_id, self.corsair_sdk, self._corsair_sdk_path, *args, **kwargs)
497118
def device(self):
		

		hdevice = self._libinput.libinput_event_get_device(self._hevent)
		return Device(hdevice, self._libinput)
965508
def device_info(self, device_id=None):
        
        if device_id is None:
            device_id = self.device_id
        return get_device_info(self.corsair_sdk, device_id)
1050769
def request(self, id, **kwargs):
        
        data = self.get('requests', id, **kwargs)
        return data
204257
def get(self, deviceId, measurementId):
        
        record = self.measurements.get(deviceId)
        if record is not None:
            return record.get(measurementId)
        return None
1106540
def device_action(device_id, action_id):
    
    success = False
    if device_id in devices:
        input_cmd = getattr(devices[device_id], action_id, None)
        if callable(input_cmd):
            input_cmd()
            success = True
    return jsonify(success=success)
164598
def get(self, device_id: int) -> Optional[Device]:
        """"""
        return self._devices.get(device_id)
493814
def filter_by_device_id(query):
    
    port_model = models_v2.Port
    unsupported_device_id_filter = [
        port_model.device_id.notilike('%s%%' % id)
        for id in utils.UNSUPPORTED_DEVICE_IDS]
    query = (query
             .filter(and_(*unsupported_device_id_filter)))
    return query
474325
public DeviceEnvelope getDevice(String deviceId) throws ApiException {
        ApiResponse<DeviceEnvelope> resp = getDeviceWithHttpInfo(deviceId);
        return resp.getData();
    }
427027
def _new_device_id(self, key):
        
        device_id = Id.SERVER + 1
        if key in self._key2deviceId:
            return self._key2deviceId[key]
        while device_id in self._clients:
            device_id += 1
        return device_id
211411
def async_get_device(self, uid, fields='*'):
        """"""
        return (yield from self._get('/pods/{}'.format(uid),
                                     fields=fields))
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)
243134
def get_widget_from_id(id):
    

    res = id.split('-')
    try:
        model_cls = apps.get_model(res[0], res[1])
        obj = model_cls.objects.get(parent=res[2], id=res[3])
    except:
        obj = None
    return obj
1257357
def delete(self, device_id: int):
        
        device = self._get_or_abort(device_id)
        session.delete(device)
        session.commit()
        return '', 204
235100
def put(self, device_id: int) -> Device:
        
        device = self._get_or_abort(device_id)
        self.update(device)
        session.commit()
        session.add(device)
        return device
1028698
def device_state(device_id):
    
    if device_id not in devices:
        return jsonify(success=False)
    return jsonify(state=devices[device_id].state)
95151
public Device getDevice(String id) throws UnknownDeviceException, NullIdException {
		if ((id == null) || (id.trim().equals(""))) {
			throw new NullIdException();
		} else {
			if (this.devices.containsKey(id)) {
				return this.devices.get(id);
			} else {
				throw new UnknownDeviceException();
			}
		}
	}