Capacitor Discharge Test
The resistor is probably to bleed off any charge within a reasonable time.  This prevents someone from getting zapped by unplugging the cord, then touching the plug pins.

Cy filter out some of the high frequency harmonics on the power line, and reduce the maximum voltage of spikes.  Since they are on the load side, they are to present a bit cleaner power to the load.  Depending on the impedance presented by the load, they can also help filter noise produced by the load from getting onto the power line.

Note that the Cy capacitors filter single ended signals, while Cx filters differential mode noise produced by the device.