returns a hash of sensors where each key is the name of the sensor and the value is the sensor
177696
def templist(refreshdata = false)
      refresh if refreshdata
      list.each_with_object({}) do |(name, sensor), tlist|
        tlist[name] = sensor if (sensor[:unit] =~ /.*degree.*/ || name =~ /.*temp.*/)
      end
    end
317545
def sensor_values(self):
        
        self.update_instance_sensors(opt="all")
        return {
            "light": self.lux,
            "water": self.soil_moisture,
            "humidity": self.humidity,
            "temperature": self.temp
        }
248179
def get_keys_from_value(self, value):
        

        return [key for key, data in self.iteritems() if data == value]
895753
def get_output_sensors(self):
        
        data = dict()
        found_sensors = get_sensors()
        if len(found_sensors) == 0:
            raise Exception("No sensors detected! "
                            "Ensure lm-sensors is installed and check the output of the `sensors` command.")
        for sensor in found_sensors:
            data[sensor.name] = self.format_sensor(sensor)
            data["{}_bar".format(sensor.name)] = self.format_sensor_bar(sensor)
        data['temp'] = max((s.current for s in found_sensors))
        return {
            'full_text': self.format.format(**data),
            'urgent': self.get_urgent(found_sensors),
            'color': self.color if not self.dynamic_color else None,
        }
892923
def get_sensors():
    
    import sensors
    found_sensors = list()

    def get_subfeature_value(feature, subfeature_type):
        subfeature = chip.get_subfeature(feature, subfeature_type)
        if subfeature:
            return chip.get_value(subfeature.number)

    for chip in sensors.get_detected_chips():
        for feature in chip.get_features():
            if feature.type == sensors.FEATURE_TEMP:
                try:
                    name = chip.get_label(feature)
                    max = get_subfeature_value(feature, sensors.SUBFEATURE_TEMP_MAX)
                    current = get_subfeature_value(feature, sensors.SUBFEATURE_TEMP_INPUT)
                    critical = get_subfeature_value(feature, sensors.SUBFEATURE_TEMP_CRIT)
                    if critical:
                        found_sensors.append(Sensor(name=name, current=current, maximum=max, critical=critical))
                except sensors.SensorsException:
                    continue
    return found_sensors
198116
def to_hash_with_values
      keys = table_header_keys
      values = self
      @hash_with_values = {}
      keys.each_with_index {|k,i| v=values[i]; v=v.value if v; @hash_with_values[k]=v}
      return @hash_with_values
    end
282430
def _Pairs(data):
    """"""
    keys = sorted(data)
    return [{'@key': k, '@value': data[k]} for k in keys]
136218
def keys(cls, name, hash_key, range_key=None, throughput=None):
        
        return cls(cls.KEYS, name, hash_key, range_key,
                   throughput=throughput)
819552
def build_sensors_list(self, type):
        
        ret = []
        if type == SENSOR_TEMP_UNIT and self.init_temp:
            input_list = self.stemps
            self.stemps = psutil.sensors_temperatures()
        elif type == SENSOR_FAN_UNIT and self.init_fan:
            input_list = self.sfans
            self.sfans = psutil.sensors_fans()
        else:
            return ret
        for chipname, chip in iteritems(input_list):
            i = 1
            for feature in chip:
                sensors_current = {}
                # Sensor name
                if feature.label == '':
                    sensors_current['label'] = chipname + ' ' + str(i)
                else:
                    sensors_current['label'] = feature.label
                # Fan speed and unit
                sensors_current['value'] = int(feature.current)
                sensors_current['unit'] = type
                # Add sensor to the list
                ret.append(sensors_current)
                i += 1
        return ret
506242
def get_names_with_value_hash( self, value_hash ):
        
        cur = self.db.cursor()
        names = namedb_get_names_with_value_hash( cur, value_hash, self.lastblock )
        return names
1132984
def to_hash
      instance_variables.each_with_object({}) do |var, h|
        h[var[1..-1].to_sym] = instance_variable_get(var)
      end
    end
520228
def to_s
      hash = {}
      @hooks_map.each_pair do |hook_event, nested_hash|
        hash[hook_event] = {}
        nested_hash.each_pair do |name, callbacks|
          hash[hook_event][name] = callbacks
        end
      end
      hash.to_s
    end
856154
def get_value(self, key):
        """"""
        for title in _TITLES.get(key, ()) + (key,):
            try:
                value = [entry['lastMeasurement']['value'] for entry in
                         self.data['sensors'] if entry['title'] == title][0]
                return value
            except IndexError:
                pass
        return None
815206
function (names) {
        this.names = Object.keys(names); // store the keys
        this.hash = util.map(names, function (value) { // store values for corresponding keys
            return parseInt(value, 10);
        });
    }
127684
def to_hash
      result = {}

      @values.each_key do |field_name|
        field = _protobuf_message_field[field_name]
        field.to_message_hash(@values, result)
      end

      result
    end
236493
def sensor_id(self):
        
        if hasattr(self, '_sensor_id'):
            return self._sensor_id
        relationships = self._json_data.get('relationships')
        sensor_id = relationships.get('sensor').get('data').get('id')
        self._sensor_id = sensor_id
        return sensor_id
32514
def keys_values(data, *keys):
    """"""
    values = []
    if is_mapping(data):
        for key in keys:
            if key in data:
                values.extend(ensure_list(data[key]))
    return values