Batch Delete Vertex Groups script

Hey there, is it possible to port this to 2.7?
It’s a very useful script and I can’t find its counterpart for the latest versions.

EDIT: To be honest, I’m specifically looking for a script that will automatically remove all empty vertex groups from an object. Would anyone be willing to help, please?