Set the 'target_id', 'target_id_mbed_htm', 'platform_name' and
        'daplink_*' attributes by reading from mbed.htm on the device
515414
def _update_device_from_htm(self, device):
        
        htm_target_id, daplink_info = self._read_htm_ids(device["mount_point"])
        if htm_target_id:
            device["target_id"] = htm_target_id
        else:
            logger.debug(
                "Could not read htm on from usb id %s. Falling back to usb id",
                device["target_id_usb_id"],
            )
            device["target_id"] = device["target_id_usb_id"]
        device["target_id_mbed_htm"] = htm_target_id
152523
def create_mbed_detector(**kwargs):
    
    host_os = platform.system()
    if host_os == "Windows":
        from .windows import StlinkDetectWindows

        return StlinkDetectWindows(**kwargs)
    elif host_os == "Linux":
        from .linux import StlinkDetectLinuxGeneric

        return StlinkDetectLinuxGeneric(**kwargs)
    elif host_os == "Darwin":
        from .darwin import StlinkDetectDarwin

        return StlinkDetectDarwin(**kwargs)
    else:
        return None
1084919
public void setTargetedDeviceCategories(com.google.api.ads.admanager.axis.v201808.Technology[] targetedDeviceCategories) {
        this.targetedDeviceCategories = targetedDeviceCategories;
    }
407343
def set_attributes(d, elm):
    """"""
    for key in d:
        elm.setAttribute(key, d[key])
1216783
private void setAliveDeadMetrics() {
    clusterManager.getMetrics().setAliveNodes(nameToNode.size());
    int totalHosts = hostsReader.getHosts().size();
    if (totalHosts > 0) {
      clusterManager.getMetrics().setDeadNodes(
          totalHosts - nameToNode.size());
    }
  }
1185542
def device_id_from_name(device_name, nodes):
        
        device_id = None
        for node in nodes:
            if device_name == node['properties']['name']:
                device_id = node['id']
                break
        return device_id
1346267
public void putDevicePipeProperty(String deviceName, DbPipe dbPipe) throws DevFailed {
        databaseDAO.putDevicePipeProperty(this, deviceName, dbPipe);
    }
997428
def _activate_thin_device(name, dm_id, size, pool):
        
        table = '0 %d thin /dev/mapper/%s %s' % (int(size) // 512, pool, dm_id)
        cmd = ['dmsetup', 'create', name, '--table', table]
        r = util.subp(cmd)
        if r.return_code != 0:
            raise MountError('Failed to create thin device: %s' %
                             r.stderr.decode(sys.getdefaultencoding()))
906497
def set_device(self, device_name):
    
    device_name = unify_device_name(device_name)
    self.device_name = device_name
    for layer in self.layers:
      layer.device_name = device_name
1311309
def manage_extant(self, **kwargs):
        '''
        '''

        self._check_device_number(kwargs['devices'])
        self.trust_domain = TrustDomain(
            devices=kwargs['devices'],
            partition=kwargs['device_group_partition']
        )
        self.device_group = DeviceGroup(**kwargs)
        self.cluster = Cluster(**kwargs)
271151
async def set_misc_settings(self, target: str, value: str):
        """"""
        params = {"settings": [{"target": target, "value": value}]}
        return await self.services["system"]["setDeviceMiscSettings"](params)
1009176
public void setDeviceCategoryTargeting(com.google.api.ads.admanager.axis.v201902.DeviceCategoryTargeting deviceCategoryTargeting) {
        this.deviceCategoryTargeting = deviceCategoryTargeting;
    }
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}
1010532
public static void setDevicePipePropertiesInDB(final String deviceName, final String pipeName,
                                                   final Map<String, String[]> properties) throws DevFailed {
        LOGGER.debug("update pipe {} device properties {} in DB ", pipeName, properties.keySet());
        DatabaseFactory.getDatabase().setDevicePipeProperties(deviceName, pipeName, properties);
    }
268155
public synchronized void setDeviceName(String name) {
        if (name.getBytes().length > DEVICE_NAME_LENGTH) {
            throw new IllegalArgumentException("name cannot be more than " + DEVICE_NAME_LENGTH + " bytes long");
        }
        Arrays.fill(announcementBytes, DEVICE_NAME_OFFSET, DEVICE_NAME_LENGTH, (byte)0);
        System.arraycopy(name.getBytes(), 0, announcementBytes, DEVICE_NAME_OFFSET, name.getBytes().length);
    }
571181
void setDeviceId(int nDeviceId) {
        synchronized (LOCK) {
            // Move this instance inside the HashMaps
            INSTANCES.get(connection()).remove(getDeviceId());
            INSTANCES.get(connection()).put(nDeviceId, this);

            this.deviceId = nDeviceId;
        }
    }
583658
def _set_description(self, node):
        '''
        
        '''
        hostname = socket.getfqdn() or platform.node()

        descr = etree.SubElement(node, 'description')
        author = etree.SubElement(descr, 'author')
        author.text = "salt.modules.node on {0}".format(hostname)
        contact = etree.SubElement(descr, 'contact')
        contact.text = 'root@{0}'.format(hostname)
        specs = etree.SubElement(descr, 'specification')
        specs.text = 'Rebuild of {0}, based on Salt inspection.'.format(hostname)

        return descr