Check if the provided file is a valid file for this plugin.

        :arg filename: the path to the file to check.
489117
def valid_file(cls, filename):
        
        file_ex = os.path.splitext(filename)[1].replace('.', '', 1)
        return file_ex in SUPPORTED_FILES and is_excel_file(filename)
650472
protected static boolean isValidFilename(String filename) {
		if (filename == null || filename.length() == 0) {
			throw new NullPointerException("文件名不能为空.");
		}
		if (filename.indexOf("..") != -1) {
			throw new IllegalArgumentException("文件名称不能包含'..'");
		}
		Matcher m = FILENAME_PATTERN.matcher(filename);
		return m.matches();
	}
282114
def check_if_committed(self, filename: str) -> bool:
        
        if os.path.isfile(filename + '.json.xz'):
            filename += '.json.xz'
        elif os.path.isfile(filename + '.json'):
            filename += '.json'
        else:
            return False
        try:
            load_structure_from_file(self.context, filename)
            return True
        except (FileNotFoundError, lzma.LZMAError, json.decoder.JSONDecodeError):
            return False
901008
def is_writable(filename):
    
    if not os.path.exists(filename):
        parentdir = os.path.dirname(filename)
        return os.path.isdir(parentdir) and os.access(parentdir, os.W_OK)
    return os.path.isfile(filename) and os.access(filename, os.W_OK)
870206
function verifyFileName (fileName)
{
    // if fileName undefined or null, throw exception
    if ((fileName === undefined) || (fileName === null)) {
        var message1 = format (cc.MSG_INVALID_NAME);
        throw new SafeFileError (cc.INVALID_NAME, message1);
    }
}
794347
def verify_file_exists(file_name, file_location):
    
    return __os.path.isfile(__os.path.join(file_location, file_name))
385723
def is_yaml_file(filename, show_warnings = False):
    
    if is_json_file(filename):
        return(False)
    try:
        config_dict = load_config(filename, file_type = "yaml")
        if(type(config_dict) == str):
            is_yaml = False
        else:
            is_yaml = True
    except:
        is_yaml = False
    return(is_yaml)
87503
def ensure_file(path):
        
        try:
            exists = isfile(path)
            if not exists:
                with open(path, 'w+') as fname:
                    fname.write('initialized')
                return (True, path)
            return (True, 'exists')
        except OSError as e:  # pragma: no cover
            return (False, e)
499815
def validate_files(pelican):
    
    for dirpath, _, filenames in os.walk(pelican.settings['OUTPUT_PATH']):
        for name in filenames:
            if should_validate(name):
                filepath = os.path.join(dirpath, name)
                validate(filepath)
289273
def valid_path?(pathname)
      # directory
      return false if pathname.directory?

      # overreaching AWS globbing
      return false if !destination_dir.to_s.empty? && !(pathname.to_s =~ /^#{destination_dir.to_s}\//)

      true
    end
714169
def isFile(self):
        
        try:
            filetype = file
        except NameError:
            filetype = io.IOBase

        return self._wrap(type(self.obj) is filetype)
650766
def _validated_config_filename(self, name):
        
        dir_name = self._make_config_dir()
        filename = os.path.join(dir_name, name.split(".json")[0] + ".json")
        return filename
826270
def is_python_script(filename):
    '''
    '''
    if filename.lower().endswith('.py'):
        return True

    if not os.path.isfile(filename):
        return False

    try:
        with open(filename, 'rb') as fp:
            if fp.read(2) != b'#!':
                return False
            return re.match(r'.*python', str_(fp.readline()))
    except IOError:
        pass

    return False
973296
def valid_file(cls, filename):
        
        return not os.path.isdir(filename) \
            and os.path.basename(filename).startswith('Session ') \
            and filename.endswith('.mqo')
215608
def isfile(path, **kwargs):
    """"""
    import os.path
    return os.path.isfile(path, **kwargs)
986176
def checkASN(filename):
    
    # Extract the file extn type:
    extnType = filename[filename.rfind('_')+1:filename.rfind('.')]

    # Determine if this extn name is valid for an assocation file
    if isValidAssocExtn(extnType):
        return True
    else:
        return False
760690
def is_image(filename):
    """"""
    # note: isfile() also accepts symlinks
    return os.path.isfile(filename) and filename.lower().endswith(ImageExts)