cherry pick plugin.py from automatic_gui_testing