Check whether the file is a standard DLL.

        This will return true only if the image has the IMAGE_FILE_DLL flag set.
497064
def is_dll(self):
        

        DLL_flag = IMAGE_CHARACTERISTICS['IMAGE_FILE_DLL']

        if ( DLL_flag & self.FILE_HEADER.Characteristics) == DLL_flag:
            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)
1128834
def _is_builtin_module(module):
    
    if (not hasattr(module, '__file__')) or  module.__name__ in sys.builtin_module_names:
        return True
    if module.__name__ in _stdlib._STD_LIB_MODULES:
        return True
    amp = os.path.abspath(module.__file__)
    if 'site-packages' in amp:
        return False
    if amp.startswith(_STD_MODULE_DIR):
        return True
    if not '.' in module.__name__:
        return False
    mn_top = module.__name__.split('.')[0]
    return mn_top in _stdlib._STD_LIB_MODULES
756134
def _CheckIsLink(self, file_entry):
    
    if definitions.FILE_ENTRY_TYPE_LINK not in self._file_entry_types:
      return False
    return file_entry.IsLink()
38578
def has_image(self, image_name):
        

        try:
            self.docker_client.images.get(image_name)
            return True
        except docker.errors.ImageNotFound:
            return False
306942
def is_progressive(image):
    
    if not isinstance(image, Image.Image):
        # Can only check PIL images for progressive encoding.
        return False
    return ('progressive' in image.info) or ('progression' in image.info)
1167758
def _use_absolute_file_name(self, img):
        
        img['file_name'] = os.path.join(
            self._imgdir, img['file_name'])
        assert os.path.isfile(img['file_name']), img['file_name']
335258
def _is_flag_file_directive(self, flag_string):
    """"""
    if isinstance(flag_string, type('')):
      if flag_string.startswith('--flagfile='):
        return 1
      elif flag_string == '--flagfile':
        return 1
      elif flag_string.startswith('-flagfile='):
        return 1
      elif flag_string == '-flagfile':
        return 1
      else:
        return 0
    return 0
1216063
def isValid( self ):
        
        check = nativestring(self._filepathEdit.text()).split(os.path.pathsep)[0]
        if ( self.filepathMode() == XFilepathEdit.Mode.SaveFile ):
            check = os.path.dirname(check)
        
        return os.path.exists(check)
638009
def is_driver(self):
        

        # Checking that the ImageBase field of the OptionalHeader is above or
        # equal to 0x80000000 (that is, whether it lies in the upper 2GB of
        # the address space, normally belonging to the kernel) is not a
        # reliable enough indicator.  For instance, PEs that play the invalid
        # ImageBase trick to get relocated could be incorrectly assumed to be
        # drivers.
         
        # This is not reliable either...
        #   
        # if any( (section.Characteristics & SECTION_CHARACTERISTICS['IMAGE_SCN_MEM_NOT_PAGED']) for section in self.sections ):
        #    return True
            
        if hasattr(self, 'DIRECTORY_ENTRY_IMPORT'):
            
            # If it imports from "ntoskrnl.exe" or other kernel components it should be a driver
            #
            if set( ('ntoskrnl.exe', 'hal.dll', 'ndis.sys', 'bootvid.dll', 'kdcom.dll' ) ).intersection( [ imp.dll.lower() for imp in self.DIRECTORY_ENTRY_IMPORT ] ):
                return True
                
        return False
918812
private static boolean registerNatives() {
        try {
            final String methodDescriptor = "zJNIBOOT_" + TaggedFileOutputStream.class.getCanonicalName().replaceAll("\\.", "_");
            long dllHandle = NativeMethodHelper.registerNatives(TaggedFileOutputStream.class, methodDescriptor, null);
            if (dllHandle > 0) {
                return true;
            }
            // if the native DLL doesnot exist, we fail quietly
            if (dllHandle == 0) {
                return false;
            }
        } catch (Throwable t) {
            // Eat exception from registerNatives if DLL can't be loaded
        }

        // if native DLL exists but failed to link the native method descriptor
        System.err.println(MessageFormat.format(BootstrapConstants.messages.getString("warn.registerNative"), TaggedFileOutputStream.class.getCanonicalName()));
        return false;
    }
1305543
def system_image_type(self, system_image_type):
        
        allowed_values = ["DOCKER_IMAGE", "VIRTUAL_MACHINE_RAW", "VIRTUAL_MACHINE_QCOW2", "LOCAL_WORKSPACE"]
        if system_image_type not in allowed_values:
            raise ValueError(
                "Invalid value for `system_image_type` ({0}), must be one of {1}"
                .format(system_image_type, allowed_values)
            )

        self._system_image_type = system_image_type
744006
def IsFile(self):
    
    if self._stat_object is None:
      self._stat_object = self._GetStat()
    if self._stat_object is not None:
      self.entry_type = self._stat_object.type
    return self.entry_type == definitions.FILE_ENTRY_TYPE_FILE
205586
public void validateImageType(BufferedImage image) {
		if (image == null) {
			throw new GeoPackageException("The image is null");
		}
		if (image.getColorModel().getTransferType() != DataBuffer.TYPE_USHORT) {
			throw new GeoPackageException(
					"The coverage data tile is expected to be a 16 bit unsigned short, actual: "
							+ image.getColorModel().getTransferType());
		}
	}
624543
public static boolean isValid( String packaging )
    {
        return MSBUILD_SOLUTION.equals( packaging ) 
                || EXE.equals( packaging ) 
                || DLL.equals( packaging ) 
                || LIB.equals( packaging );
    }
249978
def is_installed(self, name: str) -> bool:
        
        assert name is not None
        try:
            self.__docker.images.get(name)
            return True
        except docker.errors.ImageNotFound:
            return False
397531
def check_file(self):
        
        try:
            image_type = ".{0}".format(self.image.split(".")[1])
            if image_type not in self.file_format:
                print("Format: '{0}' not recognized. Use one of "
                      "them:\n{1}".format(self.image.split(".")[1],
                                          ", ".join(self.file_format)))
                raise SystemExit()
        except IndexError:
            print("slpkg: Error: Image file suffix missing")
            raise SystemExit()