def get_filtered_filename(filename, filename_key):
try:<EOL><INDENT>image_name, ext = filename.rsplit('<STR_LIT:.>', <NUM_LIT:1>)<EOL><DEDENT>except ValueError:<EOL><INDENT>image_name = filename<EOL>ext = '<STR_LIT>'<EOL><DEDENT>return "<STR_LIT>" % ({<EOL>'<STR_LIT>': image_name,<EOL>'<STR_LIT>': filename_key,<EOL>'<STR_LIT>': ext<EOL>})<EOL>
Return the 'filtered filename' (according to `filename_key`)
in the following format:
`filename`__`filename_key`__.ext