def fix_ext_py(filename):
 if filename.endswith(('.pyc', '.pyo')):
  filename = filename[:(-1)]
 return filename

def fix_ext_py ( filename ) : if filename . endswith ( ( '.pyc' , '.pyo' ) ) : filename = filename [ : ( - 1 ) ] return filename
given a .