def METHOD_NAME():
    # get selected meshes
    obs = [ob for ob in self.context.selected_objects if ob.type == 'MESH']
    # ask for weights to delete
    PREF_CUTOFF = Blender.Draw.Create(0.02)
    PREF_NBONES = Blender.Draw.Create(4)
    pup_block = [\
    ('Weight Cutoff', PREF_CUTOFF, 0.001, 0.499, 'Vertices with weight less than this number will be deleted from the vertex group.'),\
    ('Max Bones', PREF_NBONES, 1, 10, 'Also remove weakest influences so total number of bone influences is never larger than this number.'),\
    ]
    if not Blender.Draw.PupBlock('Vertex Squash', pup_block):
        return
    # saves editmode state and exit editmode if it is enabled
    # (cannot make changes mesh data in editmode)
    is_editmode = Window.EditMode()
    Window.EditMode(0)    
    Window.WaitCursor(1)
    t = sys.time()
    # run script
    num_affected = 0
    for ob in obs:
        me = ob.getData(mesh=1) # get Mesh, not NMesh
        num_affected += weight_squash(me, cutoff = PREF_CUTOFF.val, nbones = PREF_NBONES.val)
    print(f'Weight Squash finished in {(sys.time()-t):.2f} seconds')
    print(f'{num_affected} vertices removed from groups')
    Window.WaitCursor(0)
    if is_editmode: Window.EditMode(1)