Returns whether the path has had an out-of-order write.
979741
def _HasOOOWrite(self, path):
    """"""
    # Check the sizes of each path before the current one.
    size = tf.io.gfile.stat(path).length
    old_size = self._finalized_sizes.get(path, None)
    if size != old_size:
      if old_size is None:
        logger.error('File %s created after file %s even though it\'s '
                         'lexicographically earlier', path, self._path)
      else:
        logger.error('File %s updated even though the current file is %s',
                         path, self._path)
      return True
    else:
      return False
535530
def _is_path(s):
    """"""
    if isinstance(s, string_types):
        try:
            return op.exists(s)
        except (OSError, ValueError):
            return False
    else:
        return False
45851
def IsFileStatEntry(self, original_result):
    """"""
    return (original_result.pathspec.pathtype in [
        rdf_paths.PathSpec.PathType.OS, rdf_paths.PathSpec.PathType.TSK
    ])
221367
def check_cached_item(self, path):
        
        item_path = '%s/%s/%s' % (
                current_app.static_folder,
                self.cache_folder,
                path.strip('/')
            )

        if os.path.isfile(item_path):
            return '%s/%s/%s' % (current_app.static_url_path, self.cache_folder, path.strip('/'))
        else:
            return False
492198
public function check(): bool
    {
        $path = \app()->storagePath();

        $this->description = Str::replace($this->description, \compact('path'));

        return $this->checkPathIsWritable($path);
    }
1319371
def check_path(path, create=False):
    
    if not os.path.exists(path):
        if create:
            os.makedirs(path)
            return os.path.exists(path)
        else:
            return False

    return True
1089027
def is_readonly_path(fn):
    

    fn = fs_encode(fn)
    if os.path.exists(fn):
        file_stat = os.stat(fn).st_mode
        return not bool(file_stat & stat.S_IWRITE) or not os.access(fn, os.W_OK)
    return False
560790
protected boolean createDirectoryIfNotExists(Path path) throws IOException {
        if(!Files.exists(path)) {
            Files.createDirectories(path);
            return true;
        }
        else {
            return false;
        }
    }
1303574
public boolean isActivelySynced(AlluxioURI path) {
    for (AlluxioURI syncedPath : mSyncPathList) {
      try {
        if (PathUtils.hasPrefix(path.getPath(), syncedPath.getPath())) {
          return true;
        }
      } catch (InvalidPathException e) {
        return false;
      }
    }
    return false;
  }
307096
async function fileExists(path) {
  try {
    const stats = await stat(path);
    return stats.isFile() ? true : false;
  } catch (err) {
    return false;
  }
}
242639
function doesPathExist(pathToVerify) {
    let pathExists = true;

    try {
        fs.accessSync(pathToVerify);
    } catch (error) {
        pathExists = false;
    }

    return pathExists;
}
309531
def _is_out_of_order(segmentation):
    
    last_stroke = -1
    for symbol in segmentation:
        for stroke in symbol:
            if last_stroke > stroke:
                return True
            last_stroke = stroke
    return False
999008
def is_writable(path):
    """"""
    try:
        testfile = tempfile.TemporaryFile(dir=path)
        testfile.close()
    except OSError as e:
        if e.errno == errno.EACCES:  # 13
            return False
    return True
1324446
def inform_if_paths_invalid(egrc_path, examples_dir, custom_dir, debug=True):
    
    if (not debug):
        return

    if (egrc_path):
        _inform_if_path_does_not_exist(egrc_path)

    if (examples_dir):
        _inform_if_path_does_not_exist(examples_dir)

    if (custom_dir):
        _inform_if_path_does_not_exist(custom_dir)
868676
def is_prefix(cls, path):
        
        lagofile = paths.Paths(path).prefix_lagofile()
        return os.path.isfile(lagofile)
804197
public boolean isFile(Path f) throws IOException {
    try {
      return !getFileStatus(f).isDir();
    } catch (FileNotFoundException e) {
      return false;               // f does not exist
    }
  }
275221
def _GetNextPath(self):
    
    paths = sorted(path
                   for path in io_wrapper.ListDirectoryAbsolute(self._directory)
                   if self._path_filter(path))
    if not paths:
      return None

    if self._path is None:
      return paths[0]

    # Don't bother checking if the paths are GCS (which we can't check) or if
    # we've already detected an OOO write.
    if not io_wrapper.IsCloudPath(paths[0]) and not self._ooo_writes_detected:
      # Check the previous _OOO_WRITE_CHECK_COUNT paths for out of order writes.
      current_path_index = bisect.bisect_left(paths, self._path)
      ooo_check_start = max(0, current_path_index - self._OOO_WRITE_CHECK_COUNT)
      for path in paths[ooo_check_start:current_path_index]:
        if self._HasOOOWrite(path):
          self._ooo_writes_detected = True
          break

    next_paths = list(path
                      for path in paths
                      if self._path is None or path > self._path)
    if next_paths:
      return min(next_paths)
    else:
      return None