if you're ever unsure of what a function is doing, that's actually a perfect time to look up the documentation! i did a quick search here and found what your line define flash = Fade(.25, 0.0, .75, color="#fff") does:
Fade(out_time, hold_time, in_time, color="#000")
Returns a transition that takes out_time seconds to fade to a screen filled with color, holds at that screen for hold_time seconds, and then takes in_time to fade to then new screen.
and there you go! also, flipping character sprites in code is a common way to save memory. images can take up a lot of space, so being able to cut down on the number of images packaged in your game makes a smaller download and makes more efficient use of images already available!