Return true if the skin file already exists. Check memory first in a concurrent manner to
allow multiple threads to check simultaneously.
517554
@Override
    public boolean skinCssFileExists(DynamicSkinInstanceData data) {
        final String cssInstanceKey = getCssInstanceKey(data);
        // Check the existing map first since it is faster than accessing the actual file.
        if (instanceKeysForExistingCss.contains(cssInstanceKey)) {
            return true;
        }
        boolean exists = innerSkinCssFileExists(data);
        if (exists) {
            if (!supportsRetainmentOfNonCurrentCss()) {
                instanceKeysForExistingCss.clear();
            }
            instanceKeysForExistingCss.add(cssInstanceKey);
        }
        return exists;
    }
790974
function fileExists(file) {
    try {
        var targetStat = fs.statSync(file);
        if (targetStat.isDirectory() ) {
            throw new Error("File exists but it's a driectory: " + file);
        }
    }
    catch(err) {
        if (err.code == 'ENOENT') {         // No such file or directory
            return false;
        }
        else {
            throw err;
        }
    }
    return true;
}
1261662
function existsCached(testPath) {
	if (existsCache[testPath] == 1) {
		return true;
	}
	if (existsCache[testPath] == 0) {
		return false;
	}
	if (exists(testPath)) {
		existsCache[testPath] = 1;
		return true;
	}
	else {
		existsCache[testPath] = 0;
		return false;
	}
}
1016703
public boolean exists() {
		try {
			read();
			return true;
		} catch (FileFormatException e) {
			return false;
		} catch (IOException e) {
			logger.error(e);
			return false;
		}
	}
130981
function isExist(dir) {
  dir = path.normalize(dir);
  try {
    fs.accessSync(dir, fs.R_OK);
    return true;
  } catch (e) {
    return false;
  }
}
794347
def verify_file_exists(file_name, file_location):
    
    return __os.path.isfile(__os.path.join(file_location, file_name))
768963
public function cacheExists()
    {
        $cacheFile = $this->getCacheFile();
        if (file_exists($cacheFile) && filemtime($cacheFile) > (time()-$this->cachePeriod)) {
            return(true);
        } else {
            return(false);
        }
    }
259197
function fileExists(file_path) {
  try {
    var stats = fs.statSync(file_path);
    if (stats.isFile()) {
      return true;
    }
  } catch (e) {
  }
  return false;
}
887330
public static boolean exists(File file) {
        try {
            boolean fileExists = file.exists();
            if(!forceCaseSensitive || !fileExists) {
                return fileExists;
            }

            String absPath = canonicalize(file.getAbsolutePath());
            String canPath = canonicalize(file.getCanonicalPath());
            return fileExists && absPath.equals(canPath);
        } catch(IOException io) {
            return false;
        }
    }
1233472
def exists(self, pattern, seconds=None):
        
        find_time = time.time()
        r = self.clipRegionToScreen()
        if r is None:
            raise ValueError("Region outside all visible screens")
            return None
        if seconds is None:
            seconds = self.autoWaitTimeout
        if isinstance(pattern, int):
            # Actually just a "wait" statement
            time.sleep(pattern)
            return
        if not pattern:
            time.sleep(seconds)
        if not isinstance(pattern, Pattern):
            if not isinstance(pattern, basestring):
                raise TypeError("find expected a string [image path] or Pattern object")
            pattern = Pattern(pattern)
        needle = cv2.imread(pattern.path)
        if needle is None:
            raise ValueError("Unable to load image '{}'".format(pattern.path))
        needle_height, needle_width, needle_channels = needle.shape
        match = None
        timeout = time.time() + seconds

        # Consult TemplateMatcher to find needle
        while not match:
            matcher = TemplateMatcher(r.getBitmap())
            match = matcher.findBestMatch(needle, pattern.similarity)
            time.sleep(1/self._defaultScanRate if self._defaultScanRate is not None else 1/Settings.WaitScanRate)
            if time.time() > timeout:
                break

        if match is None:
            Debug.info("Couldn't find '{}' with enough similarity.".format(pattern.path))
            return None

        # Translate local position into global screen position
        position, confidence = match
        position = (position[0] + self.x, position[1] + self.y)
        self._lastMatch = Match(
            confidence,
            pattern.offset,
            (position, (needle_width, needle_height)))
        #self._lastMatch.debug_preview()
        Debug.info("Found match for pattern '{}' at ({},{}) with confidence ({}). Target at ({},{})".format(
            pattern.path,
            self._lastMatch.getX(),
            self._lastMatch.getY(),
            self._lastMatch.getScore(),
            self._lastMatch.getTarget().x,
            self._lastMatch.getTarget().y))
        self._lastMatchTime = (time.time() - find_time) * 1000 # Capture find time in milliseconds
        return self._lastMatch
365502
public function isExists()
    {
        clearstatcache(true,(string)$this->resource);
        return is_file((string)$this->resource);
    }
381835
def _one_exists(input_files):
    
    for f in input_files:
        if os.path.exists(f):
            return True
    return False
1195924
function ensureExists(path, mask, cb) {
    if (typeof mask == 'function') {
        cb = mask;
        mask = 0777;
    }

    filesystem.mkdir(path, mask, function(err) {
        if (err) {
            if (err.code == 'EEXIST') cb(null);
            else cb(err);
        } else cb(null);
    });
}
447152
def image_exists(self, image_name, tag='latest'):
        
        code, image = self.image_tags(image_name)
        if code != httplib.OK:
            return False
        tag = tag.lower()
        return any(x.lower() == tag for x in image.tags)
155177
def is_file_exists_error(e):
    
    if six.PY3:
        return isinstance(e, FileExistsError)  # noqa: F821
    else:
        return isinstance(e, OSError) and e.errno == 17
41524
def touch(self, mode=0o666, exist_ok=True):
        
        if self.exists() and not exist_ok:
            raise OSError(17, "File exists", str(self))

        self._accessor.touch(self)
1153420
public function exists()
    {
        try {
            $result = $this->getSoapClient()->ImageExists(array(
                'filename' => basename($this->filename) ,
            ));

            return ( boolean ) $result->ImageExistsResult;
        } catch ( SoapException $e ) {
            throw new StatusException('Error while verifying existence of the image' , $e);
        }
    }