def all_files(<EOL>path_name, keyword='<STR_LIT>', ext='<STR_LIT>', full_path=True,<EOL>has_date=False, date_fmt=DATE_FMT<EOL>) -> list:
if not os.path.exists(path=path_name): return []<EOL>path_name = path_name.replace('<STR_LIT:\\>', '<STR_LIT:/>')<EOL>if keyword or ext:<EOL><INDENT>keyword = f'<STR_LIT>' if keyword else '<STR_LIT:*>'<EOL>if not ext: ext = '<STR_LIT:*>'<EOL>files = sort_by_modified([<EOL>f.replace('<STR_LIT:\\>', '<STR_LIT:/>') for f in glob.iglob(f'<STR_LIT>')<EOL>if os.path.isfile(f) and (f.replace('<STR_LIT:\\>', '<STR_LIT:/>').split('<STR_LIT:/>')[-<NUM_LIT:1>][<NUM_LIT:0>] != '<STR_LIT>')<EOL>])<EOL><DEDENT>else:<EOL><INDENT>files = sort_by_modified([<EOL>f'<STR_LIT>' for f in os.listdir(path=path_name)<EOL>if os.path.isfile(f'<STR_LIT>') and (f[<NUM_LIT:0>] != '<STR_LIT>')<EOL>])<EOL><DEDENT>if has_date:<EOL><INDENT>files = filter_by_dates(files, date_fmt=date_fmt)<EOL><DEDENT>return files if full_path else [f.split('<STR_LIT:/>')[-<NUM_LIT:1>] for f in files]<EOL>
Search all files with criteria
Returned list will be sorted by last modified

Args:
    path_name: full path name
    keyword: keyword to search
    ext: file extensions, split by ','
    full_path: whether return full path (default True)
    has_date: whether has date in file name (default False)
    date_fmt: date format to check for has_date parameter

Returns:
    list: all file names with criteria fulfilled