Return True if a sensor and its child exist.
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
592096
function(child) {
      return this.length ? (/^o/.test(typeof child) ? this[0] !== child[0] && this[0].contains(child[0]) : this[0].querySelector(child) !== null) : false;
    }
472925
boolean isChild(int childId, int parentId, short weight) {
        State parent = state(parentId);
        State child;
        return parent.children.containsKey(childId) &&
                (child = state(childId)).parent == parent && child.weight == weight;
    }
521116
def is_true(entity, prop, name):
    ""
    return is_not_empty(entity, prop, name) and name in entity._data and bool(getattr(entity, name))
16775
def exists(self, using=None, **kwargs):
        
        return self._get_connection(using).indices.exists(index=self._name, **kwargs)
20769
def contains?(child)
      children.any? { |c|
        (c.kind_of?(Layout) && c.contains?(child)) || c == child
      }
    end
386182
def sensor(self, sensor_type):
        """"""
        _LOGGER.debug("Reading %s sensor.", sensor_type)
        return self._session.read_sensor(self.device_id, sensor_type)
769830
function isChild(child, parent) {
	while (child = child.parentNode) {
		if (child == parent) {
			return true;
		}
	}

	return false;
}
856524
def exists(self):
    
    try:
      return self.metadata is not None
    except datalab.utils.RequestException:
      return False
    except Exception as e:
      raise e
78348
def exists(self):
        """"""

        try:
            self.s3_object.load()
            return True
        except botocore.exceptions.ClientError: return False
534682
private boolean isAccelerating(SensorEvent event) {
    float ax = event.values[0];
    float ay = event.values[1];
    float az = event.values[2];

    // Instead of comparing magnitude to ACCELERATION_THRESHOLD,
    // compare their squares. This is equivalent and doesn't need the
    // actual magnitude, which would be computed using (expensive) Math.sqrt().
    final double magnitudeSquared = ax * ax + ay * ay + az * az;
    return magnitudeSquared > accelerationThreshold * accelerationThreshold;
  }
805411
def isalive (self):
        ''' '''

        if self.child_fd == -1:
            return False
        try:
            os.fstat(self.child_fd)
            return True
        except:
            return False
656581
def hasCamera(self, nDeviceIndex):
        """"""

        fn = self.function_table.hasCamera
        pHasCamera = openvr_bool()
        result = fn(nDeviceIndex, byref(pHasCamera))
        return result, pHasCamera
856136
private static boolean parentExists(Resource res) {
	res = res.getParentResource();
	return res != null && res.exists();
    }
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
901616
def has_parent(self, term):
        """"""
        for parent in self.parents:
            if parent.item_id == term or parent.has_parent(term):
                return True
        return False
1129467
def has_child(self, value):
        
        for node in self.children:
            if node.value == value:
                return True

        return False