Set the plugin type.

        4 types of stats is possible in the sensors plugin:
        - Core temperature: 'temperature_core'
        - Fan speed: 'fan_speed'
        - HDD temperature: 'temperature_hdd'
        - Battery capacity: 'battery'
431752
def __set_type(self, stats, sensor_type):
        
        for i in stats:
            # Set the sensors type
            i.update({'type': sensor_type})
            # also add the key name
            i.update({'key': self.get_key()})

        return stats
212865
private function _temperature()
    {
        if (PSI_OS == 'WINNT') {
            if ($this->_buf) foreach ($this->_buf as $buffer) {
                if (isset($buffer['CurrentTemperature']) && (($value = ($buffer['CurrentTemperature'] - 2732)/10) > -100)) {
                    $dev = new SensorDevice();
                    if (isset($buffer['InstanceName']) && preg_match("/([^\\\\ ]+)$/", $buffer['InstanceName'], $outbuf)) {
                        $dev->setName('ThermalZone '.$outbuf[1]);
                    } else {
                        $dev->setName('ThermalZone THM0_0');
                    }
                    $dev->setValue($value);
                    if (isset($buffer['CriticalTripPoint']) && (($maxvalue = ($buffer['CriticalTripPoint'] - 2732)/10) > 0)) {
                        $dev->setMax($maxvalue);
                    }
                    $this->mbinfo->setMbTemp($dev);
                }
            }
        } else {
            $notwas = true;
            $thermalzones = glob('/sys/class/thermal/thermal_zone*/');
            if (is_array($thermalzones) && (count($thermalzones) > 0)) foreach ($thermalzones as $thermalzone) {
                $thermalzonetemp = $thermalzone.'temp';
                $temp = null;
                if (CommonFunctions::rfts($thermalzonetemp, $temp, 1, 4096, false) && !is_null($temp) && (($temp = trim($temp)) != "")) {
                    if ($temp >= 1000) {
                        $div = 1000;
                    } elseif ($temp >= 200) {
                        $div = 10;
                    } else {
                       $div = 1;
                    }
                    $temp = $temp / $div;

                    if ($temp > -40) {
                        $dev = new SensorDevice();
                        $dev->setValue($temp);

                        $temp_type = null;
                        if (CommonFunctions::rfts($thermalzone.'type', $temp_type, 1, 4096, false) && !is_null($temp_type) && (($temp_type = trim($temp_type)) != "")) {
                            $dev->setName($temp_type);
                        } else {
                            $dev->setName("ThermalZone");
                        }

                        $temp_max = null;
                        if (CommonFunctions::rfts($thermalzone.'trip_point_0_temp', $temp_max, 1, 4096, false) && !is_null($temp_max) && (($temp_max = trim($temp_max)) != "") && ($temp_max > -40)) {
                            $temp_max = $temp_max / $div;
                            if (($temp_max != 0) || ($temp != 0)) { // if non-zero values
                                $dev->setMax($temp_max);
                                $this->mbinfo->setMbTemp($dev);
                            }
                        } else {
                            $this->mbinfo->setMbTemp($dev);
                        }
                        $notwas = false;
                    }
                }
            }
            if ($notwas) {
                $thermalzones = glob('/proc/acpi/thermal_zone/TH*/temperature');
                if (is_array($thermalzones) && (count($thermalzones) > 0)) foreach ($thermalzones as $thermalzone) {
                    $temp = null;
                    if (CommonFunctions::rfts($thermalzone, $temp, 1, 4096, false) && !is_null($temp) && (($temp = trim($temp)) != "")) {
                        $dev = new SensorDevice();
                        if (preg_match("/^\/proc\/acpi\/thermal_zone\/(.+)\/temperature$/", $thermalzone, $name)) {
                           $dev->setName("ThermalZone ".$name[1]);
                        } else {
                            $dev->setName("ThermalZone");
                        }
                        $dev->setValue(trim(substr($temp, 23, 4)));
                        $this->mbinfo->setMbTemp($dev);
                    }
                }
            }
        }
    }
1238607
def setSpeedFactor(self, typeID, factor):
        
        self._connection._sendDoubleCmd(
            tc.CMD_SET_VEHICLETYPE_VARIABLE, tc.VAR_SPEED_FACTOR, typeID, factor)
1209103
def _set_stats(self, input_stats):
        """"""
        # Build the all_stats with the get_raw() method of the plugins
        return {p: self._plugins[p].get_raw() for p in self._plugins if self._plugins[p].is_enable()}
400082
def set_defaults(self):
        
        self['mswitch'] = '***FILES***'
        self['elem'] = '../grid/elem.dat'
        self['elec'] = '../grid/elec.dat'
        self['rho'] = '../rho/rho.dat'
        self['config'] = '../config/config.dat'
        self['write_pots'] = 'F'  # ! potentials ?
        self['pot_file'] = '../mod/pot/pot.dat'
        self['write_volts'] = 'T'  # ! measurements ?
        self['volt_file'] = '../mod/volt.dat'
        self['write_sens'] = 'F'  # ! sensitivities ?
        self['sens_file'] = '../mod/sens/sens.dat'
        self['another_dataset'] = 'F'  # ! another dataset ?
        self['2D'] = '1'  # ! 2D (=0) or 2.5D (=1)
        self['fictitious_sink'] = 'F'  # ! fictitious sink ?
        self['sink_node'] = '1660'  # ! fictitious sink node number
        self['boundary_values'] = 'F'  # ! boundary values ?
        self['boundary_file'] = 'boundary.dat'
11359
def get(id_, hwid, type_, unit, precision, as_json):
    """"""
    if id_ and (hwid or type_):
        raise click.BadOptionUsage(
            "If --id is given --hwid and --type are not allowed."
        )

    if id_:
        try:
            sensor = W1ThermSensor.get_available_sensors()[id_ - 1]
        except IndexError:
            raise click.BadOptionUsage(
                "No sensor with id {0} available. "
                "Use the ls command to show all available sensors.".format(id_)
            )
    else:
        sensor = W1ThermSensor(type_, hwid)

    if precision:
        sensor.set_precision(precision, persist=False)

    temperature = sensor.get_temperature(unit)

    if as_json:
        data = {
            "hwid": sensor.id,
            "type": sensor.type_name,
            "temperature": temperature,
            "unit": unit,
        }
        click.echo(json.dumps(data, indent=4, sort_keys=True))
    else:
        click.echo(
            "Sensor {0} measured temperature: {1} {2}".format(
                click.style(sensor.id, bold=True),
                click.style(str(temperature), bold=True),
                click.style(unit, bold=True),
            )
        )
720282
def set_enclosure(self):
        """"""
        try:
            self.enclosure_url = self.soup.find('enclosure')['url']
        except:
            self.enclosure_url = None
        try:
            self.enclosure_type = self.soup.find('enclosure')['type']
        except:
            self.enclosure_type = None
        try:
            self.enclosure_length = self.soup.find('enclosure')['length']
            self.enclosure_length = int(self.enclosure_length)
        except:
            self.enclosure_length = None
1272116
private function _fans()
    {
        if (isset($this->_filecontent["fans"]) && (trim($this->_filecontent["fans"]) !== "")) {
            $values = preg_split("/ /", trim($this->_filecontent["fans"]));
            foreach ($values as $id=>$value) {
                $dev = new SensorDevice();
                $dev->setName("fan".$id);
                $dev->setValue($value);
                $this->mbinfo->setMbFan($dev);
            }
        }
    }
597492
final private function set_setting_types() {

		// Apply the kirki_setting_types filter.
		$this->setting_types = apply_filters(
			'kirki_setting_types',
			[
				'default'     => 'WP_Customize_Setting',
				'repeater'    => '\Kirki_Settings_Repeater_Setting',
				'user_meta'   => '\Kirki\Core\Setting\User_Meta',
				'site_option' => '\Kirki\Core\Setting\Site_Option',
			]
		);

		// Make sure the defined classes actually exist.
		foreach ( $this->setting_types as $key => $classname ) {

			if ( ! class_exists( $classname ) ) {
				unset( $this->setting_types[ $key ] );
			}
		}
	}
733230
private function _fans()
    {
        foreach ($this->_buf as $sensor) {
            if (((isset($sensor['Sensor Type (Threshold)']) && ($sensor['Sensor Type (Threshold)'] == 'Fan'))
                ||(isset($sensor['Sensor Type (Analog)']) && ($sensor['Sensor Type (Analog)'] == 'Fan')))
               && isset($sensor['Unit']) && ($sensor['Unit'] == 'RPM')
               && isset($sensor['Value'])) {
                $dev = new SensorDevice();
                $dev->setName($sensor['Sensor']);
                $dev->setValue($value = $sensor['Value']);
                if (isset($sensor['Lower Critical']) && (($min = $sensor['Lower Critical']) != "na")) {
                    $dev->setMin($min);
                } elseif (isset($sensor['Upper Critical']) && (($max = $sensor['Upper Critical']) != "na")
                          && ($max < $value)) { // max instead min issue
                    $dev->setMin($max);
                }
                if (isset($sensor['Status']) && (($status = $sensor['Status']) != "ok")) {
                    $dev->setEvent($status);
                }
                $this->mbinfo->setMbFan($dev);
            }
        }
    }
1156821
private void setupTypes() {
    if (!cache2kConfigurationWasProvided) {
      cache2kConfiguration.setKeyType(config.getKeyType());
      cache2kConfiguration.setValueType(config.getValueType());
    } else {
      if (cache2kConfiguration.getKeyType() == null) {
        cache2kConfiguration.setKeyType(config.getKeyType());
      }
      if (cache2kConfiguration.getValueType() == null) {
        cache2kConfiguration.setValueType(config.getValueType());
      }
    }
    keyType = cache2kConfiguration.getKeyType();
    valueType = cache2kConfiguration.getValueType();
    if (!config.getKeyType().equals(Object.class) && !config.getKeyType().equals(keyType.getType())) {
      throw new IllegalArgumentException("Key type mismatch between JCache and cache2k configuration");
    }
    if (!config.getValueType().equals(Object.class) && !config.getValueType().equals(valueType.getType())) {
      throw new IllegalArgumentException("Value type mismatch between JCache and cache2k configuration");
    }
  }
401474
private function _fans()
    {
        foreach ($this->_lines as $line) {
            $buffer = preg_split("/\s*\|\s*/", $line);
            if ($buffer[2] == "Fan" && $buffer[11] != "N/A" && $buffer[4] == "RPM") {
                $dev = new SensorDevice();
                $dev->setName($buffer[1]);
                $dev->setValue($buffer[3]);
                if ($buffer[6] != "N/A") {
                    $dev->setMin($buffer[6]);
                } elseif (($buffer[9] != "N/A") && ($buffer[9]<$buffer[3])) { //max instead min issue
                    $dev->setMin($buffer[9]);
                }
                if ($buffer[11] != "'OK'") $dev->setEvent(trim($buffer[11], "'"));
                $this->mbinfo->setMbFan($dev);
            }
        }
    }
103529
public void setEnableLogTypes(java.util.Collection<String> enableLogTypes) {
        if (enableLogTypes == null) {
            this.enableLogTypes = null;
            return;
        }

        this.enableLogTypes = new com.amazonaws.internal.SdkInternalList<String>(enableLogTypes);
    }
1228330
def set_object_info(self):
        
        self.attrs.pandas_type = str(self.pandas_kind)
        self.attrs.pandas_version = str(_version)
        self.set_version()
378856
protected function initPluginType()
    {
        $dispatcher = $this->client->getEventDispatcher();
        $dispatcher->addListener(SolariumEvents::PRE_EXECUTE_REQUEST, array($this, 'preExecuteRequest'), 1000);
        $dispatcher->addListener(SolariumEvents::POST_EXECUTE_REQUEST, array($this, 'postExecuteRequest'), -1000);
    }
188347
def set_parameters(self):
        
        for key in dir(self):
            if key.startswith('REQUIRES_'):
                setattr(self, key, getattr(self.gmpe, key))
            if key.startswith('DEFINED_'):
                if not key.endswith('FOR_INTENSITY_MEASURE_TYPES'):
                    setattr(self, key, getattr(self.gmpe, key))
301263
private function _fans()
    {
        for ($intPosi = 13; $intPosi < 16; $intPosi++) {
            if (!isset($this->_buf_value[$intPosi])) {
                continue;
            }
            preg_match("/([0-9\.])*/", str_replace(",", ".", $this->_buf_value[$intPosi]), $hits);
            $dev = new SensorDevice();
            $dev->setName($this->_buf_label[$intPosi]);
            $dev->setValue($hits[0]);
//            $dev->setMin(3000);
            $this->mbinfo->setMbFan($dev);
        }
    }