Determines if the file entry is a pipe.

    Returns:
      bool: True if the file entry is a pipe.
168672
def IsPipe(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_PIPE
1036405
def is_path_python_module(thepath):
    
    thepath = path.normpath(thepath)

    if path.isfile(thepath):
        base, ext = path.splitext(thepath)
        if ext in _py_suffixes:
            return True
        return False

    if path.isdir(thepath):
        for suffix in _py_suffixes:
            if path.isfile(path.join(thepath, '__init__%s' % suffix)):
                return True
    return False
877472
def _is_morphology_file(filepath):
    
    return (
        os.path.isfile(filepath) and
        os.path.splitext(filepath)[1].lower() in ('.swc', '.h5', '.asc')
    )
363966
def FileEntryExistsByPathSpec(self, path_spec):
    
    # Opening a file by MFT entry is faster than opening a file by location.
    # However we need the index of the corresponding $FILE_NAME MFT attribute.
    fsntfs_file_entry = None
    location = getattr(path_spec, 'location', None)
    mft_attribute = getattr(path_spec, 'mft_attribute', None)
    mft_entry = getattr(path_spec, 'mft_entry', None)

    try:
      if mft_attribute is not None and mft_entry is not None:
        fsntfs_file_entry = self._fsntfs_volume.get_file_entry(mft_entry)
      elif location is not None:
        fsntfs_file_entry = self._fsntfs_volume.get_file_entry_by_path(location)

    except IOError as exception:
      raise errors.BackEndError(exception)

    return fsntfs_file_entry is not None
842695
def _is_device(path):
    '''
    
    '''
    out = __salt__['cmd.run_all']('file -i {0}'.format(path))
    _verify_run(out)

    # Always [device, mime, charset]. See (file --help)
    return re.split(r'\s+', out['stdout'])[1][:-1] == 'inode/blockdevice'
415892
def intty(cls):
        
        # XXX: temporary hack until we can detect if we are in a pipe or not
        return True

        if hasattr(sys.stdout, 'isatty') and sys.stdout.isatty():
            return True

        return False
1222308
def is_dir(self, pathobj):
        
        try:
            stat = self.stat(pathobj)

            return stat.is_dir
        except OSError as exc:
            if exc.errno != errno.ENOENT:
                raise
            return False
901008
def is_writable(filename):
    
    if not os.path.exists(filename):
        parentdir = os.path.dirname(filename)
        return os.path.isdir(parentdir) and os.access(parentdir, os.W_OK)
    return os.path.isfile(filename) and os.access(filename, os.W_OK)
916748
def isPe32(self):
        
        if self.ntHeaders.optionalHeader.magic.value == consts.PE32:
            return True
        return False
246114
def iseof(self):
        """"""
        succ = windll.kernel32.PeekNamedPipe(
            self.conout_pipe, None, None, None, None, None
        )
        return not bool(succ)
800022
def _CheckIsSocket(self, file_entry):
    
    if definitions.FILE_ENTRY_TYPE_SOCKET not in self._file_entry_types:
      return False
    return file_entry.IsSocket()
334702
def is_file(self, path):
        """"""
        return (samefile(path, self.device_file) or
                samefile(path, self.loop_file) or
                any(samefile(path, mp) for mp in self.mount_paths) or
                sameuuid(path, self.id_uuid) or
                sameuuid(path, self.partition_uuid))
230519
def is_file(cls, file):
        ''''''
        peeked_data = wpull.string.printable_bytes(
            wpull.util.peek_file(file)).lower()

        if b'<html' in peeked_data:
            return VeryFalse

        if re.search(br'@import |color:|background[a-z-]*:|font[a-z-]*:',
                     peeked_data):
            return True
22312
def file_is_present(self, file_path):
        
        p = self.p(file_path)
        if not os.path.exists(p):
            return False
        if not os.path.isfile(p):
            raise IOError("%s is not a file" % file_path)
        return True
782697
def IsNTFS(self):
    
    tsk_fs_type = self.GetFsType()
    return tsk_fs_type in [
        pytsk3.TSK_FS_TYPE_NTFS, pytsk3.TSK_FS_TYPE_NTFS_DETECT]
154921
def is_readable(fpath):
    
    return os.path.isfile(fpath) and os.access(fpath, os.R_OK)
409142
def is_platform_file(path):
    
    if not os.path.exists(path) or os.path.islink(path):
        return False
    # If the header is fat, we need to read into the first arch
    fileobj = open(path, 'rb')
    bytes = fileobj.read(MAGIC_LEN)
    if bytes == FAT_MAGIC_BYTES:
        # Read in the fat header
        fileobj.seek(0)
        header = mach_o.fat_header.from_fileobj(fileobj, _endian_='>')
        if header.nfat_arch < 1:
            return False
        # Read in the first fat arch header
        arch = mach_o.fat_arch.from_fileobj(fileobj, _endian_='>')
        fileobj.seek(arch.offset)
        # Read magic off the first header
        bytes = fileobj.read(MAGIC_LEN)
    fileobj.close()
    for magic in MAGIC:
        if bytes == magic:
            return True
    return False