How to quick Delete All Bones - deform options Off - NO SKIN

Hi,
Anyone know how to write script: Delete all bones with deform options off - NO SKIN?

I need this to quick convert rig form other software.

Thanks.

edit:
better idea: How to select all bones from vertex group?