Returns true if there's a webcam available, false otherwise.
965793
public static boolean isWebcamPresent(){
        try {
            Webcam.getDefault(WebcamConstants.DEFAULT_WEBCAM_LOOKUP_TIMEOUT);
            return true;
        } catch (Throwable exception) {
            LOG.debug("Problem occurred when detecting the webcam. Returning false.", exception);
            return false;
        }
    }
809483
def has_pixels(self):
        
        return any(
            ci.id >= 0 and cd.data and len(cd.data) > 0
            for ci, cd in zip(self._record.channel_info, self._channels)
        )
447152
def image_exists(self, image_name, tag='latest'):
        
        code, image = self.image_tags(image_name)
        if code != httplib.OK:
            return False
        tag = tag.lower()
        return any(x.lower() == tag for x in image.tags)
462739
boolean isMonitored(HttpSession session) {
		boolean monitor = false;
		if (null != session && session.getAttribute(Constants.Options.OPTIONS) != null) {
			monitor = ((Options) session.getAttribute(Constants.Options.OPTIONS)).isMonitor();
		}
		return monitor;
	}
270658
public function isAvailable()
    {
        // First, test Imagick's extension and classes.
        if (false === extension_loaded('imagick') ||
            false === class_exists('Imagick') ||
            false === class_exists('ImagickDraw') ||
            false === class_exists('ImagickPixel') ||
            false === class_exists('ImagickPixelIterator')
        ) {
            return false;
        }

        return true;
    }
142035
public static Webcam getDefault() throws WebcamException {

		try {
			return getDefault(Long.MAX_VALUE);
		} catch (TimeoutException e) {
			// this should never happen since user would have to wait 300000000
			// years for it to occur
			throw new RuntimeException(e);
		}
	}
529172
public static boolean isLocalCameraUri(Uri uri) {
    String uriString = uri.toString();
    return uriString.startsWith(MediaStore.Images.Media.EXTERNAL_CONTENT_URI.toString())
        || uriString.startsWith(MediaStore.Images.Media.INTERNAL_CONTENT_URI.toString());
  }
630332
public boolean videoIsMuted() {
        boolean isMuted = true;

        if (!audioOnly && (null != localStream)) {
            for (MediaStreamTrack eachTrack : localStream.videoTracks) {
                if (eachTrack.enabled()) {
                    isMuted = false;
                }
            }
        }

        return isMuted;
    }
892996
public Webcam getWebcam(String name, Dimension dimension) {
        if (name == null) {
            return getWebcam(dimension);
        }

        Webcam webcam = webcams.get(name);
        openWebcam(webcam, dimension);
        return webcam;
    }
1118968
async def _request(self, path):
        """"""
        url = '{}{}'.format(self.base_url, path)
        data = None

        try:
            async with self.websession.get(url, auth=self._auth, timeout=self._timeout) as response:
                if response.status == 200:
                    if response.headers['content-type'] == 'application/json':
                        data = await response.json()
                    else:
                        data = await response.text()

        except (asyncio.TimeoutError, aiohttp.ClientError) as error:
            _LOGGER.error('Failed to communicate with IP Webcam: %s', error)
            self._available = False
            return

        self._available = True
        if isinstance(data, str):
            return data.find("Ok") != -1
        return data
1229024
def is_image(self, key):
        """"""
        data = self.model.get_data()
        return isinstance(data[key], Image)
266655
public static boolean sdpHasVideo(JSONObject sdp) {
        boolean hasVideo = false;

        if (null != sdp) {
            try {
                String sdpString = sdp.getString("sdp");
                hasVideo = sdpString.contains("m=video");
            } catch (JSONException e) {
                // Bad SDP?
                Log.d(TAG, "ERROR: Incoming call appears to have an invalid SDP");
            }
        }

        return hasVideo;
    }
411262
def isVideo(self):
        
        val=False
        if self.__dict__['codec_type']:
            if self.codec_type == 'video':
                val=True
        return val
38578
def has_image(self, image_name):
        

        try:
            self.docker_client.images.get(image_name)
            return True
        except docker.errors.ImageNotFound:
            return False
777948
public boolean detectNintendo() {

        if ((userAgent.indexOf(deviceNintendo) != -1)
            || (userAgent.indexOf(deviceWii) != -1)
            || (userAgent.indexOf(deviceNintendoDs) != -1)) {
            return true;
        }
        return false;
    }
51361
def watch(cams, path=None, delay=10):
    """"""
    while True:
        for c in cams:
            c.snap(path)
        time.sleep(delay)
153737
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
    public static boolean hasCameraFeatureAtLeastOne(PackageManager manager) {
        return manager.hasSystemFeature(PackageManager.FEATURE_CAMERA_ANY);
    }