Return true if the file has already been injected before.
964044
def injected(self, filename):
        
        full_path = os.path.expanduser(filename)
        if not os.path.exists(full_path):
            return False
        with codecs.open(full_path, 'r+', encoding="utf-8") as fh:
            contents = fh.read()
        return self.wrapper_match.search(contents) is not None
147238
public boolean checkModified(LightFileDescriptor other) {
        if (isAlwaysModified() || other.isAlwaysModified())
            return true;

        if (!name.equals(other.name))
            return true;

        if (!(hasChecksum() && other.hasChecksum()) && !(hasModificationDate() && other.hasModificationDate()))
            // No intersecting characteristics, cant compare => file is modified
            return true;

        if (hasChecksum() && other.hasChecksum() && !Arrays.equals(checksum, other.checksum))
            return true;

        if (hasModificationDate() && other.hasModificationDate() && !lastModified.equals(other.lastModified))
            return true;

        return false;
    }
253730
def is_extracted(self, file_path):
        

        if os.path.isdir(file_path):
            self.chatbot.logger.info('File is already extracted')
            return True
        return False
367250
def resolve(self, current_file, rel_path):
    """"""
    p = path.join(path.dirname(current_file), rel_path)
    if p not in self.file_dict:
      raise RuntimeError('No such fake file: %r' % p)
    return p, p
1317090
private boolean isCacheValid()
  {
    long now = CurrentTime.currentTime();

    if ((now - _lastTime < 100) && ! CurrentTime.isTest())
      return true;

    long oldLastModified = _lastModified;
    long oldLength = _length;
    
    long newLastModified = getBacking().getLastModified();
    long newLength = getBacking().length();
    
    _lastTime = now;

    if (newLastModified == oldLastModified && newLength == oldLength) {
      _lastTime = now;
      return true;
    }
    else {
      _changeSequence.incrementAndGet();
      
      // If the file has changed, close the old file
      clearCache();
      
      _zipEntryCache.clear();
      
      _lastModified = newLastModified;
      _length = newLength;
      
      _lastTime = now;

      return false;
    }
  }
1127241
boolean checkForChanges()
    {
        // initialize with last checked files
        final Map<File, byte[]> presents = new HashMap<>(fingerprints);
        boolean modified = traverseDirectory(location, new IFileVisitor()
        {
            @Override
            public boolean visitFile(File file)
            {
                return modified(presents.remove(file), file);
            }

            @Override
            public boolean visitDir(File dir)
            {
                return modified(presents.remove(dir), dir);
            }
        });
        // if some files remain, that means they have been deleted since last scan
        return modified || !presents.isEmpty();
    }
218448
function isUsed (name) {
        if (module.isUsed(name)) {
          return true
        }
        if (dupes.length > 0) {
          return dupes.some((dupe) => {
            const m = analyzer.modules.get(dupe.file)
            return m && m.isUsed(name)
          })
        }
        return false
      }
738927
def isfile(self, relpath):
    """"""
    if self.isignored(relpath):
      return False
    return self._isfile_raw(relpath)
792918
def is_cached(self, path, saltenv='base', cachedir=None):
        '''
        
        '''
        if path.startswith('salt://'):
            path, senv = salt.utils.url.parse(path)
            if senv:
                saltenv = senv

        escaped = True if salt.utils.url.is_escaped(path) else False

        # also strip escape character '|'
        localsfilesdest = os.path.join(
            self.opts['cachedir'], 'localfiles', path.lstrip('|/'))
        filesdest = os.path.join(
            self.opts['cachedir'], 'files', saltenv, path.lstrip('|/'))
        extrndest = self._extrn_path(path, saltenv, cachedir=cachedir)

        if os.path.exists(filesdest):
            return salt.utils.url.escape(filesdest) if escaped else filesdest
        elif os.path.exists(localsfilesdest):
            return salt.utils.url.escape(localsfilesdest) \
                if escaped \
                else localsfilesdest
        elif os.path.exists(extrndest):
            return extrndest

        return ''
877749
def _EnsureFileExists(self):
        """"""
        if not os.path.exists(self._filename):
            old_umask = os.umask(0o177)
            try:
                open(self._filename, 'a+b').close()
            except OSError:
                return False
            finally:
                os.umask(old_umask)
        return True
828175
private boolean isReady() {

		assert disposed != null;
		assert open != null;

		if (disposed.get()) {
			LOG.warn("Cannot get image, webcam has been already disposed");
			return false;
		}

		if (!open.get()) {
			if (autoOpen) {
				open();
			} else {
				return false;
			}
		}

		return true;
	}
16950
def isNewer(firstFile, secondFile):
    
    assert os.path.exists(firstFile)
    assert os.path.exists(secondFile)
    return os.path.getctime(firstFile) > os.path.getctime(secondFile)
259197
function fileExists(file_path) {
  try {
    var stats = fs.statSync(file_path);
    if (stats.isFile()) {
      return true;
    }
  } catch (e) {
  }
  return false;
}
605409
def has(self):
        """"""
        self._done = os.path.exists(self._cache_file)
        return self._done or self._out is not None
711865
public boolean containsFile(File f) {
		return unchangedFiles.contains(f) || newFiles.contains(f)
				|| updatedFiles.contains(f) || deletedFiles.contains(f)
				|| recursedDirectories.contains(f)
				|| failedTransfers.containsKey(f);
	}
802995
def check(self, diff):
        """"""
        path = pathlib.Path(diff.b_path)
        filename = path.parts[-1]
        if filename == '__init__.py':
            abspath = self.project.path.joinpath(path)
            assert isemptyfile(abspath)
1294101
def has_file_changed(directory, checksums, filetype='genbank'):
    """"""
    pattern = NgdConfig.get_fileending(filetype)
    filename, expected_checksum = get_name_and_checksum(checksums, pattern)
    full_filename = os.path.join(directory, filename)
    # if file doesn't exist, it has changed
    if not os.path.isfile(full_filename):
        return True

    actual_checksum = md5sum(full_filename)
    return expected_checksum != actual_checksum