def remove_file_extension(filename):
 for suff in EXTENSION_SUFFIXES:
  if filename.endswith(suff):
   return filename[0:filename.rfind(suff)]
 return os.path.splitext(filename)[0]

def remove_file_extension ( filename ) : for suff in EXTENSION_SUFFIXES : if filename . endswith ( suff ) : return filename [ 0 : filename . rfind ( suff ) ] return os . path . splitext ( filename ) [ 0 ]
this function returns filename without its extension .