<s> import os <EOL> def files_and_folders ( dir_path = '<STR_LIT:.>' ) : <EOL> '''<STR_LIT>''' <EOL> f_and_f = os . listdir ( dir_path ) <EOL> folders = [ f for f in f_and_f if os . path . isdir ( os . path . abspath ( f ) ) ] <EOL> files = set ( f_and_f ) - set ( folders ) <EOL> return { '<STR_LIT>' : tuple ( sorted ( files , key = str . lower ) ) , <EOL> '<STR_LIT>' : tuple ( sorted ( folders , key = str . lower ) ) } <EOL> def old_files_and_folders ( dir_path = '<STR_LIT:.>' ) : <EOL> files = [ ] <EOL> folders = [ ] <EOL> for filename in sorted ( os . listdir ( dir_path ) ) : <EOL> if os . path . isdir ( os . path . join ( dir_path , filename ) ) : <EOL> folders . append ( filename ) <EOL> else : <EOL> files . append ( filename ) <EOL> return tuple ( files ) , tuple ( folders ) <EOL> print ( files_and_folders ( ) ) </s>
