test whether path exists
343741
def pathExists(self, path):
        
        def commandComplete(cmd):
            return not cmd.didFail()

        return self.runRemoteCommand('stat', {'file': path,
                                              'logEnviron': self.logEnviron, },
                                     abandonOnFailure=False,
                                     evaluateCommand=commandComplete)
1117914
public boolean exists (HttpServletRequest req, String path)
    {
        return (getMessage(req, path, false) != null);
    }
1004902
def check_exists(path, type='file'):
    

    if type == 'file':
        if not os.path.isfile(path):
            raise RuntimeError('The file `%s` does not exist.' % path)
    else:
        if not os.path.isdir(path):
            raise RuntimeError('The folder `%s` does not exist.' % path)

    return True
514229
def exists_locally(cls, path):
    """"""
    # If INFO file doesn't exist, consider resource does NOT exist, as it would
    # prevent guessing the `extract_method`.
    return (tf.io.gfile.exists(path) and
            tf.io.gfile.exists(_get_info_path(path)))
275163
def check_path(self, path):
        
        path = os.path.abspath(path)
        if os.path.exists(path):
            return path
        else:
            utils.die("input file does not exists:\n  {}".format(path))
68709
def executable_exists(executable):
    """"""
    for directory in os.getenv("PATH").split(":"):
        if os.path.exists(os.path.join(directory, executable)):
            return True
    return False
1211396
def _paths_must_exists(path):
    
    path = to_unicode(path)
    if not os.path.exists(path):
        raise argparse.ArgumentTypeError("{} is not a valid file/folder.".format(path))
    return path
1233282
def exists(self, path):
        
        _complain_ifclosed(self.closed)
        return self.fs.exists(path)
1254266
def check_file_path(self, path):
        
        if os.path.exists(path) is not True:
            msg = "File Not Found {}".format(path)
            raise OSError(msg)
1073260
def check_file_exists(self, remote_cmd="dir home"):
        """"""
        if self.direction == "put":
            remote_out = self.ssh_ctl_chan.send_command_expect(remote_cmd)
            search_string = r"Directory contents .*{}".format(self.dest_file)
            return bool(re.search(search_string, remote_out, flags=re.DOTALL))
        elif self.direction == "get":
            return os.path.exists(self.dest_file)
560955
def _is_path(instance, attribute, s, exists=True):
    ""
    if not s:
        # allow False as a default
        return
    if exists:
        if os.path.exists(s):
            return
        else:
            raise OSError("path does not exist")
    else:
        # how do we tell if it's a path if it doesn't exist?
        raise TypeError("Not a path?")
604209
function fileExistsSync(path) {
  if (fs.existsSync) {
    return fs.existsSync(path);
  } else {
    try {
      fs.statSync(path);
      return true;
    } catch (e) {
      return false;
    }
  }
}
539284
def path_exist? path
      if path.is_a? Pathname
        return path.exist?
      elsif path.is_a? String
        return Pathname.new(path).exist?
      else
        return false
      end
    end
1128416
public static function exists(string $path) : bool
    {
        try {
            return ErrorCatcher::run(static function() use ($path) {
                return file_exists($path);
            });
        } catch (\ErrorException $e) {
            throw new IoException('Error checking if ' . $path . ' exists', 0, $e);
        }
    }
557647
def find_in_path(path, file):
  """"""
  for p in path.split(os.pathsep):
    candidate = os.path.join(p, file)
    if os.path.exists(candidate) and os.path.isfile(candidate):
      return candidate
  return False
1203657
function existsSync(path) {
    if ( path === null || path === undefined )
        return false;

    try {
        Fs.statSync(path);
        return true;
    } catch (err) {
        return checkErr(err);
    }
}
1352440
def exists(self, path):
        
        import hdfs
        try:
            self.client.status(path)
            return True
        except hdfs.util.HdfsError as e:
            if str(e).startswith('File does not exist: '):
                return False
            else:
                raise e