The top level container for a group of sensors.
164413
function Device(key, params) {
  var p = params || {};
  // The primary key of the device [String]
  this.key = key;

  // Human readable name of the device [String] EG - "My Device"
  this.name = p.name || "";

  // Indexable attributes. Useful for grouping related Devices.
  // EG - {location: '445-w-Erie', model: 'TX75', region: 'Southwest'}
  this.attributes = p.attributes || {};
  this.sensors = p.sensors || [];
}
208797
function buildContainerGroups() {
            let container = svg
                .append('g')
                  .classed('container-group', true)
                  .attr('transform', `translate(${margin.left}, ${margin.top})`);

            container
                .append('g').classed('grid-lines-group', true);
            container
                .append('g').classed('chart-group', true);
            container
                .append('g').classed('axis-group', true);
            container
                .append('g').classed('metadata-group', true);

            if (hasTitle()) {
                container.selectAll('.chart-group')
                  .attr('transform', `translate(${legendSpacing}, 0)`);
            }
        }
228155
private function _fans()
    {
        if (isset($this->_buf['Fan'])) foreach ($this->_buf['Fan'] as $name=>$value) {
            $dev = new SensorDevice();
            $dev->setName($name);
            $dev->setValue($value);
            $this->mbinfo->setMbFan($dev);
        }
    }
907809
function (cb, context) {
        var zlevelList = this._zlevelList;
        var z;
        var i;
        for (i = 0; i < zlevelList.length; i++) {
            z = zlevelList[i];
            cb.call(context, this._layers[z], z);
        }
    }
245590
function setup() {
        $dataStore = new PersonalDataStoreStub();
        $this->eventStore = new TestEventStoreSpy();

        $this->container = new ContainerStub();
        $this->container->set(EventStore::class, $this->eventStore);

        $this->classMap  = new DomainEventClassMap();
        $this->commandBus = new ReflectionResolutionCommandBus($this->container);

        $this->serializer = new ReflectionBasedDomainEventSerializer(
            $this->classMap,
            new ValueSerializer($dataStore),
            $dataStore
        );
    }
971612
def is_sensor(self, sensorid, child_id=None):
        """"""
        ret = sensorid in self.sensors
        if not ret:
            _LOGGER.warning('Node %s is unknown', sensorid)
        if ret and child_id is not None:
            ret = child_id in self.sensors[sensorid].children
            if not ret:
                _LOGGER.warning('Child %s is unknown', child_id)
        if not ret and parse_ver(self.protocol_version) >= parse_ver('2.0'):
            _LOGGER.info('Requesting new presentation for node %s',
                         sensorid)
            msg = Message(gateway=self).modify(
                node_id=sensorid, child_id=SYSTEM_CHILD_ID,
                type=self.const.MessageType.internal,
                sub_type=self.const.Internal.I_PRESENTATION)
            if self._route_message(msg):
                self.add_job(msg.encode)
        return ret
1296309
def getSensors(self):
        
        sensors = array([])
        sensors = r_[sensors, self._getTotalDemandSensor()]
#        sensors = r_[sensors, self._getDemandSensor()]
#        sensors = r_[sensors, self._getPriceSensor()]

#        sensors = r_[sensors, self._getBusVoltageSensor()]

#        sensors = r_[sensors, self._getBusVoltageMagnitudeSensor()]
#        sensors = r_[sensors, self._getBusVoltageLambdaSensor()]
#        sensors = r_[sensors, self._getBranchFlowSensor()]

#        logger.info("State: %s" % sensors)

        return sensors
283144
def _check_forest(self, sensors):
        """"""
        if self in sensors:
            raise ValueError('Circular dependency in sensors: %s is its own'
                             'parent.' % (self.name,))
        sensors.add(self)
        for parent in self._parents:
            parent._check_forest(sensors)
226441
def getAllSensors(self):
        
        j = 0
        sensors = []
        parameters = {'page':0, 'per_page':1000, 'owned':1}
        while True:
            parameters['page'] = j
            if self.SensorsGet(parameters):
                s = json.loads(self.getResponse())['sensors']
                sensors.extend(s)
            else:
                # if any of the calls fails, we cannot be cannot be sure about the sensors in CommonSense
                return None

            if len(s) < 1000:
                break

            j += 1

        return sensors
1063938
private function _fans()
    {
        foreach ($this->_lines as $line) {
            if (preg_match('/^hw\.sensors\.[0-9]+=[^\s,]+,\s+([^,]+),\s+fanrpm,\s+([0-9\.]+)\s+RPM.*$/', $line, $ar_buf)) {
                $dev = new SensorDevice();
                $dev->setName($ar_buf[1]);
                $dev->setValue($ar_buf[2]);
                $this->mbinfo->setMbFan($dev);
            } elseif (preg_match('/^hw\.sensors\.[0-9]+=[^\s,]+,\s+([^,]+),\s+([0-9\.]+)\s+RPM$/', $line, $ar_buf)) {
                $dev = new SensorDevice();
                $dev->setName($ar_buf[1]);
                $dev->setValue($ar_buf[2]);
                $this->mbinfo->setMbFan($dev);
            } elseif (preg_match('/^hw\.sensors\.[^\.]+\.(.*)=([0-9\.]+)\s+RPM\s+\((.*)\)$/', $line, $ar_buf)) {
                $dev = new SensorDevice();
                $dev->setName($ar_buf[3]);
                $dev->setValue($ar_buf[2]);
                $this->mbinfo->setMbFan($dev);
            } elseif (preg_match('/^hw\.sensors\.[^\.]+\.(.*)=([0-9\.]+)\s+RPM$/', $line, $ar_buf)) {
                $dev = new SensorDevice();
                $dev->setName($ar_buf[1]);
                $dev->setValue($ar_buf[2]);
                $this->mbinfo->setMbFan($dev);
            }
        }
    }
1153662
def get_sensors_summary(self):
        
        sub_title_list = self.get_sensor_list()

        graph_vector_summary = OrderedDict()
        for graph_idx, graph_data in enumerate(self.last_measurement):
            val_str = str(round(graph_data, 1))
            graph_vector_summary[sub_title_list[graph_idx]] = val_str

        return graph_vector_summary
698029
def add_sensor(self, sensorid=None):
        """"""
        if sensorid is None:
            sensorid = self._get_next_id()
        if sensorid is not None and sensorid not in self.sensors:
            self.sensors[sensorid] = Sensor(sensorid)
        return sensorid if sensorid in self.sensors else None
1183438
function initReactors(container) {
        var isBatch = container === 'batch';

        // loop through each reactor and call init if it exists
        _.each(reactors, function (reactor) {
            if (reactor.init) {
                reactor.init({ config: config, pancakes: pancakes });
            }
        });

        // most reactors will be through the resource reactor definitions
        _.each(resources, function (resource) {                     // loop through all the resources
            _.each(resource.reactors, function (reactData) {        // loop through reactors
                if (isBatch && reactData.type === 'audit') {        // don't do anything if audit for batch
                    return;                                         // since audit not needed for batch
                }

                var eventTriggers = {                               // events that will trigger this propgation
                    resources:  [resource.name],
                    adapters:   reactData.trigger.adapters,
                    methods:    reactData.trigger.methods
                };

                // add the event handler
                eventBus.addHandlers(eventTriggers, reactHandler(reactData));
            });
        });
    }
71554
function() {
		
		for (var cI in this.layer.containers) {
	    	var c = this.layer.containers[cI];
	    
	    	var checkPoints = this.getContainerCorners(c);
	    	var inside = true;
	    
	    	for (var i in checkPoints)
				inside &= this.rubberband.pointIsInside(checkPoints[i].x, checkPoints[i].y);
		
	    	if (inside) {
				this.addContainer(c);
	    	}
		}
	
   }
945794
def setup_sensors(self):
        """"""
        self._add_result = Sensor.float("add.result",
            "Last ?add result.", "", [-10000, 10000])
        self._add_result.set_value(0, Sensor.UNREACHABLE)

        self._time_result = Sensor.timestamp("time.result",
            "Last ?time result.", "")
        self._time_result.set_value(0, Sensor.INACTIVE)

        self._eval_result = Sensor.string("eval.result",
            "Last ?eval result.", "")
        self._eval_result.set_value('', Sensor.UNKNOWN)

        self._fruit_result = Sensor.discrete("fruit.result",
            "Last ?pick-fruit result.", "", self.FRUIT)
        self._fruit_result.set_value('apple', Sensor.ERROR)

        self.add_sensor(self._add_result)
        self.add_sensor(self._time_result)
        self.add_sensor(self._eval_result)
        self.add_sensor(self._fruit_result)
702922
def set_sampling_strategies(self, filter, strategy_and_parms):
        """"""
        result_list = yield self.list_sensors(filter=filter)
        sensor_dict = {}
        for result in result_list:
            sensor_name = result.object.normalised_name
            resource_name = result.object.parent_name
            if resource_name not in sensor_dict:
                sensor_dict[resource_name] = {}
            try:
                resource_obj = self.children[resource_name]
                yield resource_obj.set_sampling_strategy(sensor_name, strategy_and_parms)
                sensor_dict[resource_name][sensor_name] = strategy_and_parms
                self._logger.debug(
                    'Set sampling strategy on resource %s for %s'
                    % (resource_name, sensor_name))
            except Exception as exc:
                self._logger.error(
                    'Cannot set sampling strategy on resource %s for %s (%s)'
                    % (resource_name, sensor_name, exc))
                sensor_dict[resource_name][sensor_name] = None
        raise tornado.gen.Return(sensor_dict)
793052
function buildContainerGroups(){
            let container = svg
              .append('g')
                .classed('container-group', true)
                .attr('transform', `translate(${margin.left},${margin.top})`);

            container
              .append('g').classed('x-axis-group', true)
              .append('g').classed('axis x', true);
            container.selectAll('.x-axis-group')
              .append('g').classed('month-axis', true);
            container
              .append('g').classed('y-axis-group', true)
              .append('g').classed('axis y', true);
            container
              .append('g').classed('grid-lines-group', true);
            container
              .append('g').classed('chart-group', true);
            container
              .append('g').classed('metadata-group', true);
        }