given a path check a the file exists with any of the set extensions
975919
function tryExtensions(p, exts, isMain) {
  for (var i = 0; i < exts.length; i++) {
    const filename = tryFile(p + exts[i], isMain);

    if (filename) {
      return filename;
    }
  }
  return false;
}
125123
def exists(self, digest):
        
        if not isinstance(digest, string_types):
            raise TypeError("digest must be a string")
        return os.path.isfile(self.get_file_path(digest))
727962
def do_files_exist(filenames):
  """"""
  preexisting = [tf.io.gfile.exists(f) for f in filenames]
  return any(preexisting)
1126036
def check_files_exist(filenames):
    ''''''
    files_not_found = [x for x in filenames if not os.path.exists(x)]
    if len(files_not_found):
        for filename in files_not_found:
            print('File not found: "', filename, '"', sep='', file=sys.stderr)
        raise Error('File(s) not found. Cannot continue')
399580
def has_file_extension(filepath, ext_required):
    '''
    '''
    ext = os.path.splitext(filepath)[-1]
    if ext != ext_required:
        msg_tmpl = "The extension for {}, which is {}, does not equal {}"
        msg_format = msg_tmpl.format(filepath, ext, ext_required)
        raise ValueError(msg_format)
    return True
186930
def exists(self, filename):
        """"""
        client = boto3.client("s3")
        bucket, path = self.bucket_and_path(filename)
        r = client.list_objects(Bucket=bucket, Prefix=path, Delimiter="/")
        if r.get("Contents") or r.get("CommonPrefixes"):
            return True
        return False
388091
def exists(self, path):
        
        (bucket, key) = self._path_to_bucket_and_key(path)

        # root always exists
        if self._is_root(key):
            return True

        # file
        if self._exists(bucket, key):
            return True

        if self.isdir(path):
            return True

        logger.debug('Path %s does not exist', path)
        return False
130899
def _file_and_exists(val, input_files):
    
    return ((os.path.exists(val) and os.path.isfile(val)) or
            val in input_files)
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
1015001
def exists(self, fileDirSpec, **kwargs):
            

            str_path        = self.cwd()
            for k,v in kwargs.items():
                if k == 'path': str_path    = v
            if fileDirSpec in self.lstr_lsnode(str_path):
                return True
            if fileDirSpec in self.lsf(str_path):
                return True
            return False
994783
def _HasFile(self, file_name):
    """"""
    if self._zip:
      return file_name in self._zip.namelist()
    else:
      file_path = os.path.join(self._path, file_name)
      return os.path.exists(file_path) and os.path.isfile(file_path)
219870
def validate_path_exists(s):
    """"""
    if s is None:
        return None
    if os.path.exists(s):
        return s
    else:
        raise ValueError('"%s" should be a path but it does not exist' % s)
1139973
def exists(self, full_path):
        """"""
        if path.exists(self.new_path(full_path)):
            return self.new_path(full_path)
966973
def exists(self):
        
        path = self.path
        if '*' in path or '?' in path or '[' in path or '{' in path:
            logger.warning("Using wildcards in path %s might lead to processing of an incomplete dataset; "
                           "override exists() to suppress the warning.", path)
        return self.fs.exists(path)
675130
def check_existing_filename (filename, onlyfiles=True):
    """"""
    if not os.path.exists(filename):
        raise PatoolError("file `%s' was not found" % filename)
    if not os.access(filename, os.R_OK):
        raise PatoolError("file `%s' is not readable" % filename)
    if onlyfiles and not os.path.isfile(filename):
        raise PatoolError("`%s' is not a file" % filename)
67919
function fileExists(file, handle) {
		fs.exists(file, function(exists) {
			handle.apply(null, exists ? [file] : []);
		});
	}
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