Return device information, if device_id is not specified, return for this device

        :param device_id: id of device
        :type device_id: int
        :returns: dict containing information about device
        :rtype: dict
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)
340284
def get_devices_from_response_dict(response_dict, device_type):
    
    items = response_dict.get('data')

    devices = []

    api_interface = WinkApiInterface()
    check_list = isinstance(device_type, (list,))

    for item in items:
        if (check_list and get_object_type(item) in device_type) or \
                (not check_list and get_object_type(item) == device_type):
            _devices = build_device(item, api_interface)
            for device in _devices:
                devices.append(device)

    return devices
215553
def update_device_info(self, device_id, display_name):
        
        content = {
            "display_name": display_name
        }
        return self._send("PUT", "/devices/%s" % device_id, content=content)
1280211
def device_at_index(self, index):
        
        if index >= len(self.__xid_cons):
            raise ValueError("Invalid device index")

        return self.__xid_cons[index]
340630
def DeviceGet(self, device_id):
        
        if self.__SenseApiCall__('/devices/{0}'.format(device_id), 'GET'):
            return True
        else:
            self.__error__ = "api call unsuccessful"
            return False
432231
def get_device_element(self, ain):
        """"""
        elements = self.get_device_elements()
        for element in elements:
            if element.getAttribute('identifier') == ain:
                return element
        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)
98420
def device_uuid(self):
        """"""
        if self._device:
            return self._device
        return GEN_ID_FORMAT.format(self.src_ip)
69355
def get(self, deviceId, measurementId):
        
        record = self.measurements.get(deviceId)
        if record is not None:
            measurement = record.get(measurementId)
            if measurement.recording:
                device = self.recordingDevices.get(deviceId)
                device.signalStop()
                return measurement, 200
            else:
                return measurement, 400
        return '', 400
1314307
def _find_device(self, idVendor, idProduct):
        """"""
        for bus in usb.busses():
            for device in bus.devices:
                if (device.idVendor == idVendor and
                    device.idProduct == idProduct):
                    return device
        return None
474325
public DeviceEnvelope getDevice(String deviceId) throws ApiException {
        ApiResponse<DeviceEnvelope> resp = getDeviceWithHttpInfo(deviceId);
        return resp.getData();
    }
150868
def get_device_info_for_agent(self, context, hosting_device_db):
        
        template = hosting_device_db.template
        mgmt_port = hosting_device_db.management_port
        mgmt_ip = (mgmt_port['fixed_ips'][0]['ip_address']
                   if mgmt_port else hosting_device_db.management_ip_address)
        return {'id': hosting_device_db.id,
                'name': template.name,
                'template_id': template.id,
                'credentials': self._get_credentials(hosting_device_db),
                'host_category': template.host_category,
                'admin_state_up': hosting_device_db.admin_state_up,
                'service_types': template.service_types,
                'management_ip_address': mgmt_ip,
                'protocol_port': hosting_device_db.protocol_port,
                'timeout': None,
                'created_at': str(hosting_device_db.created_at),
                'status': hosting_device_db.status,
                'booting_time': template.booting_time}
629461
def enrolled_device_id(self, enrolled_device_id):
        
        if enrolled_device_id is None:
            raise ValueError("Invalid value for `enrolled_device_id`, must not be `None`")
        if enrolled_device_id is not None and not re.search('^[A-Za-z0-9]{32}', enrolled_device_id):
            raise ValueError("Invalid value for `enrolled_device_id`, must be a follow pattern or equal to `/^[A-Za-z0-9]{32}/`")

        self._enrolled_device_id = enrolled_device_id
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)
        )
1356636
def evdev_device(self):
        
        devices = [evdev.InputDevice(fn) for fn in evdev.list_devices()]

        for device in devices:
            if device.name == self.evdev_device_name:
                return device

        raise Exception("%s: could not find evdev device '%s'" % (self, self.evdev_device_name))
171632
def getDevice(self, id):
        
        return next(iter([d for d in self.devices.values() if d.deviceId == id]), None)
161101
def get_hosting_device_driver(self, context, id):
        """"""
        if id is None:
            return
        try:
            return self._hosting_device_drivers[id]
        except KeyError:
            try:
                template = self._get_hosting_device_template(context, id)
                self._hosting_device_drivers[id] = importutils.import_object(
                    template['device_driver'])
            except (ImportError, TypeError, n_exc.NeutronException):
                LOG.exception("Error loading hosting device driver for "
                              "hosting device template %s", id)
            return self._hosting_device_drivers.get(id)