Obtain details of a single device

            @param device_id (int) - Device for which to obtain details
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
1090578
def port_id_from_name(port_name, device_id, nodes):
        
        port_id = None
        for node in nodes:
            if device_id == node['id']:
                for port in node['ports']:
                    if port_name == port['name']:
                        port_id = port['id']
                        break
                break
        return port_id
792684
def get(self, dev_id):
        """"""
        path = '/'.join(['device', dev_id])
        return self.rachio.get(path)
763913
def _dev_by_id(self, device_type):
        
        dir = os.path.join("/dev", device_type, "by-id")
        if os.path.isdir(dir):
            to_ret = dict(
                self._hex_ids([os.path.join(dir, f) for f in os.listdir(dir)])
            )
            return to_ret
        else:
            logger.error(
                "Could not get %s devices by id. "
                "This could be because your Linux distribution "
                "does not use udev, or does not create /dev/%s/by-id "
                "symlinks. Please submit an issue to github.com/"
                "armmbed/mbed-ls.",
                device_type,
                device_type,
            )
            return {}
951723
def generate_device_id(steamid):
    
    h = hexlify(sha1_hash(str(steamid).encode('ascii'))).decode('ascii')
    return "android:%s-%s-%s-%s-%s" % (h[:8], h[8:12], h[12:16], h[16:20], h[20:32])
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)
        )
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();
			}
		}
	}
1190376
function (applicationId, deviceDetails, environment) {
    if(!applicationId) {
        logger.wtf('No applicationID specified');
    }
    
    this.applicationId = applicationId;
    this.deviceDetails = deviceDetails;
    this.environment = environment;
    this._currentAds = [];
    this._loadingAds = [];
    this._adsWithoutImages = [];
}
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
1356790
def find_device(device=None):
    '''
    
    '''

    data = [{'uid': '/zport/dmd/Devices', 'params': {}, 'limit': None}]
    all_devices = _router_request('DeviceRouter', 'getDevices', data=data)
    for dev in all_devices['devices']:
        if dev['name'] == device:
            # We need to save the has for later operations
            dev['hash'] = all_devices['hash']
            log.info('Found device %s in Zenoss', device)
            return dev

    log.info('Unable to find device %s in Zenoss', device)
    return None
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
1240236
def folder_get_info(self, folder_key=None, device_id=None, details=None):
        
        return self.request('folder/get_info', QueryParams({
            'folder_key': folder_key,
            'device_id': device_id,
            'details': details
        }))
886899
public DeviceTypeEnvelope getDeviceType(String deviceTypeId) throws ApiException {
        ApiResponse<DeviceTypeEnvelope> resp = getDeviceTypeWithHttpInfo(deviceTypeId);
        return resp.getData();
    }
333040
def listDevices(self, interface_id):
        """"""
        LOG.debug("RPCFunctions.listDevices: interface_id = %s, _devices_raw = %s" % (
            interface_id, str(self._devices_raw)))
        remote = interface_id.split('-')[-1]
        if remote not in self._devices_raw:
            self._devices_raw[remote] = []
        if self.systemcallback:
            self.systemcallback('listDevices', interface_id)
        return self._devices_raw[remote]
1338521
def stringify_device_meta(device_object):
    
    try:
        if isinstance(device_object['info']['description']['meta'], dict):
            device_object['info']['description']['meta'] =\
                json.dumps(device_object['info']['description']['meta'])
    except ValueError as err:
        print("stringify: {0}".format(err))
    return device_object
213388
def get_android_device_data(udid)
      specs = { os: 'ro.build.version.release', manufacturer: 'ro.product.manufacturer', model: 'ro.product.model', sdk: 'ro.build.version.sdk' }
      hash = {}
      specs.each do |key, spec|
        value = `adb -s #{udid} shell getprop "#{spec}"`.strip
        hash.merge!(key => value.to_s)
      end
      hash
    end
486694
def refresh_details(self):
        ''''''
        try:
            return self.api_iface._api_get("/api/v2/devices/" + str(self.device_id))
        except APIError as e:
            print("API error: ")
            for key,value in e.data.iteritems:
                print(str(key) + ": " + str(value))