Returns False if the file is binary or image.
438596
def _is_good_file_for_multiqc(fpath):
    """"""
    # Use mimetypes to exclude binary files where possible
    (ftype, encoding) = mimetypes.guess_type(fpath)
    if encoding is not None:
        return False
    if ftype is not None and ftype.startswith('image'):
        return False
    return True
176779
def is_binary(path):
    '''
    
    '''
    if not os.path.isfile(path):
        return False
    try:
        with fopen(path, 'rb') as fp_:
            try:
                data = fp_.read(2048)
                if six.PY3:
                    data = data.decode(__salt_system_encoding__)
                return salt.utils.stringutils.is_binary(data)
            except UnicodeDecodeError:
                return True
    except os.error:
        return False
398682
function isBinary (file) {
  return new Promise((resolve, reject) => {
    isTextOrBinary.isText(Path.basename(file.path), file.contents, (err, isText) => {
      if (err) return reject(err);
      if (isText) file.isText = true;
      resolve(file);
    });
  });
}
665537
def is_portrait(file_):
    
    if sorl_settings.THUMBNAIL_DUMMY:
        return sorl_settings.THUMBNAIL_DUMMY_RATIO < 1
    if not file_:
        return False
    image_file = default.kvstore.get_or_set(ImageFile(file_))
    return image_file.is_portrait()
372142
def is_filelike(ob):
    
    if hasattr(ob, 'read') and callable(ob.read):
        return True

    if hasattr(ob, 'write') and callable(ob.write):
        return True

    return False
935209
def is_binary(filename):
    
    logger.debug('is_binary: %(filename)r', locals())

    # Check if the file extension is in a list of known binary types
    binary_extensions = ['pyc', 'iso', 'zip', 'pdf']
    for ext in binary_extensions:
        if filename.endswith(ext):
            return True

    # Check if the starting chunk is a binary string
    chunk = get_starting_chunk(filename)
    return is_binary_string(chunk)
762242
public function isImage() {
		try {
			if (!function_exists('exif_imagetype') && !function_exists('Jodit\exif_imagetype')) {
				function exif_imagetype($filename) {
					if ((list(, , $type) = getimagesize($filename)) !== false) {
						return $type;
					}

					return false;
				}
			}

			return in_array(exif_imagetype($this->getPath()), [IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG, IMAGETYPE_BMP]);
		} catch (\Exception $e) {
			return false;
		}
	}
647526
def IsImage(self, filename):
		""""""
		mimetype =  mimetypes.guess_type(filename)[0]
		if not mimetype:
			return False
		return mimetype.startswith("image/")
1007638
def _data_is_binary(self, data):
        """"""
        if isinstance(data, six.binary_type):
            return True
        elif isinstance(data, list):
            return functools.reduce(
                lambda a, b: a or b, [self._data_is_binary(item)
                                      for item in data], False)
        elif isinstance(data, dict):
            return functools.reduce(
                lambda a, b: a or b, [self._data_is_binary(item)
                                      for item in six.itervalues(data)],
                False)
        else:
            return False
160802
def binary(self):
        

        return self._project.loader.find_object_containing(self.addr, membership_check=False)
942418
def binary_thin(image, strel1, strel2):
    
    hit_or_miss = scind.binary_hit_or_miss(image, strel1, strel2)
    return np.logical_and(image,np.logical_not(hit_or_miss))
876817
def is_bytes(string):
    
    if six.PY3 and isinstance(string, (bytes, memoryview, bytearray)):  # noqa
        return True
    elif six.PY2 and isinstance(string, (buffer, bytearray)):  # noqa
        return True
    return False
1002328
public static boolean isBlack(BufferedImage image, int x, int y) {
        if (image.getType() == BufferedImage.TYPE_BYTE_BINARY) {
            WritableRaster raster = image.getRaster();
            int pixelRGBValue = raster.getSample(x, y, 0);
            return pixelRGBValue == 0;
        }

        int luminanceValue = 140;
        return isBlack(image, x, y, luminanceValue);
    }
831918
def isfile(self, version=None, *args, **kwargs):
        '''
        
        '''
        version = _process_version(self, version)

        path = self.get_version_path(version)
        self.authority.fs.isfile(path, *args, **kwargs)
726934
private static boolean isImage(String hexString) {
    	boolean isImage = false;
    	//png
    	if (hexString.startsWith("89504e470d0a1a0a")) {    		
    		isImage = true;
    	//gif	
    	} else if (hexString.startsWith("474946383761") || hexString.startsWith("474946383961")) {    		
    		isImage = true;
    	// jpeg	
    	} else if (hexString.startsWith("ffd8ffe0")) {    		
    		isImage = true;
    	}
    	return isImage;    	
    }
334675
def is_binary_address(value: Any) -> bool:
    
    if not is_bytes(value):
        return False
    elif len(value) != 20:
        return False
    else:
        return True
1303670
def _is_valid_file(self, path):
        """"""
        return isinstance(path, basestring) and os.path.isfile(path)