Internal: Is the blob minified files?

 Consider a file minified if the average line length is
 greater then 110c.

 Currently, only JS and CSS files are detected by this method.

 Returns true or false.
163118
def minified_files?
      return unless ['.js', '.css'].include? extname
      if lines.any?
        (lines.inject(0) { |n, l| n += l.length } / lines.length) > 110
      else
        false
      end
    end
625358
@GuardedBy("mLock")
  private boolean maybeUpdateFileCacheSize() {
    long now = mClock.now();
    if ((!mCacheStats.isInitialized()) ||
        mCacheSizeLastUpdateTime == UNINITIALIZED ||
        (now - mCacheSizeLastUpdateTime) > FILECACHE_SIZE_UPDATE_PERIOD_MS) {
      return maybeUpdateFileCacheSizeAndIndex();
    }
    return false;
  }
787897
def is_file(cls, file):
        ''''''
        peeked_data = wpull.string.printable_bytes(
            wpull.util.peek_file(file)).lower()

        if b'<!doctype html' in peeked_data \
           or b'<head' in peeked_data \
           or b'<title' in peeked_data \
           or b'<html' in peeked_data \
           or b'<script' in peeked_data \
           or b'<table' in peeked_data \
           or b'<a href' in peeked_data:
            return True
605416
function isPackageMeta(file) {
  if (file.match(/^readme(\.[^\.]*)$/i)) {
    return true;
  }
  if (file.match(/^(license|licence)(\.[^\.]*)?$/i)) {
    return true;
  }
  if (file.match(/^(notice)(\.[^\.]*)?$/i)) {
    return true;
  }
  if (file.match(/^(changes|changelog|history)(\.[^\.]*)?$/i)) {
    return true;
  }
}
34489
def is_filelike(obj):
    
    if isinstance(obj, (bytes, unicode)):
        return False
    res = True
    for a in ('read', 'tell', 'seek'):
        res = res and hasattr(obj, a)
    if not res:
        raise ValueError("Invalid object passed as file")
    return True
534311
def _file_not_empty(tmpfile):
        
        if os.path.exists(tmpfile):
            return os.stat(tmpfile).st_size != 0
        else:
            return False
772094
public boolean isIncludeFile()
    {
        if (value != null && value.length() > 0 && CmdLine.INCLUDE_FILE_PREFIX.charAt(0) == value.charAt(0))
            return true;
        return false;
    }
809100
def IsBinary(self, filename):
		""""""
		mimetype = mimetypes.guess_type(filename)[0]
		if not mimetype:
			return False  # e.g. README, "real" binaries usually have an extension
		# special case for text files which don't start with text/
		if mimetype in TEXT_MIMETYPES:
			return False
		return not mimetype.startswith("text/")
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
125974
function isHtmlFileUptodate(source) {
    var dependencies = source.tag("dependencies") || [];
    var i, dep, file, prj = source.prj(),
    stat,
    mtime = source.modificationTime();
    for (i = 0 ; i < dependencies.length ; i++) {
        dep = dependencies[i];
        file = prj.srcOrLibPath(dep);
        if (file) {
            stat = FS.statSync(file);
            if (stat.mtime > mtime) return false;
        }
    }
    return source.isUptodate();
}
1014452
private boolean isOverFileLimit(int addition) {
        if (LogFile.UNLIMITED == getMaximumSize()) {
            return false;
        }
        // Note: to do this properly, we need to know if the admin updates the
        // file externally, i.e. 'cat /dev/null > file' to clear it out. Windows
        // JDK filechannel.size() was a buffered value (AIX was not), but the
        // file.length() call on each checked the real value each time. This is
        // a slight performance hit but it's the only 100% guarentee of being
        // accurate.
        long newlen = this.myFile.length() + addition;
        return (newlen > getMaximumSize() || 0 > newlen);
    }
252437
public boolean isNotMinified(File file) {
        return !file.getName().endsWith("min.css")
                && !file.getName().endsWith(cssMinifierSuffix + ".css");
    }
1149819
def is_bgzf(filename):
  
  with open(filename,'rb') as inf:
   bytes1 = inf.read(12)
   if len(bytes1) != 12:
     sys.stderr.write("File length ERROR\n")
     return False
   try:
     gzip_id1,gzip_id2,compression_method,flag,mtime,xfl,osval,xlen=struct.unpack('<BBBBIBBH',bytes1)
   except:
     sys.stderr.write("Unpack ERROR\n")
     return False
   if gzip_id1 != 31:
     sys.stderr.write("ID1 ERROR\n")
     return False
   if gzip_id2 != 139:
     sys.stderr.write("ID2 ERROR\n")
     return False
   if compression_method != 8:
     sys.stderr.write("Compression Method ERROR\n")
     return False
   if flag != 4:
     sys.stderr.write("flg ERROR\n")
     return False
   if xlen < 6:
     sys.stderr.write("no extra fields ERROR\n")
   # ready to look in extra field
   bytes2 = inf.read(xlen) # all the extra field stuff 
   if len(bytes2) != xlen: 
     sys.stderr.write("file length ERROR\n")
     return False
   s = StringIO.StringIO(bytes2)
   has_id = False
   obsslen = 0
   while True:
     v1 = s.read(4)
     if len(v1) == 0: break
     if len(v1) < 4:
       sys.stderr.write("lack header values ERROR\n")
       return False
     s1,s2,slen = struct.unpack('<BBH',v1)
     if s1 == 66 and s2 == 67:
       has_id = True
       obsslen = slen
     v = s.read(slen)
     if len(v) != slen:
       sys.stderr.write("extra field read ERROR\n")
       return False
   if not has_id or not obsslen == 2:
     sys.stderr.write("no proper extra header ERROR\n")
     return False
  return True
1344667
private function minify($filename = false, $files, $yuicompressor, $baseDir, $width = null)
    {
        $content = '';
        if ($width === null) {
            $extra = '';
        } else {
            $extra = '--line-break '.intval($width);
        }

        foreach ($files as $file) {
            if (file_exists($baseDir.$file)) {
                $result = exec("java -jar $yuicompressor $extra $baseDir$file ");
                $content .= (defined('_MODE') && _MODE == 1 ? "/* $file */" : '')."$result\n";
                echo "\n    Add: $file";
            } else {
                echo "\n    Err: $file - not found.";
            }
        }
            //return minyfied data
        if ($filename === false) {
            return $content;
        }

            echo "\n Saving: $filename\n";
            file_put_contents($baseDir.$filename, $content);
            echo "\n Minified ..\n";
    }
171462
public static boolean isModifed(File file, long lastModifyTime) {
		if (null == file || false == file.exists()) {
			return true;
		}
		return file.lastModified() != lastModifyTime;
	}
931075
def is_text_file(filename):
    
    try:
        open(filename)
    except Exception:
        return False
    with open(filename, 'rb') as fid:
        try:
            CHUNKSIZE = 1024
            chunk = fid.read(CHUNKSIZE)
            # check for a UTF BOM
            for bom in [BOM_UTF8, BOM_UTF16, BOM_UTF32]:
                if chunk.startswith(bom):
                    return True
            chunk = chunk.decode('utf-8')
            while 1:
                if '\0' in chunk:  # found null byte
                    return False
                if len(chunk) < CHUNKSIZE:
                    break  # done
                chunk = fid.read(CHUNKSIZE).decode('utf-8')
        except UnicodeDecodeError:
            return False
        except Exception:
            pass
    return True
684980
private static boolean isSupported(final File file)
        {
        final String extension = FilenameUtils.getExtension(file.getName());
        if (StringUtils.isBlank(extension))
            {
            return false;
            }
        
        final String[] types = 
            {
            "mp3", "aif", "aiff", "wav", "mp2", "mp4",
            "aac", "mid", "m4a", "m4p", "ogg"
            };
        if (ArrayUtils.contains(types, extension.toLowerCase()))
            {
            return true;
            }
        return false;
        }