def METHOD_NAME(li):
    in_loop = lambda vi: (li * len(verts) <= vi) and (vi < (li + 1) * len(verts))
    for vi, v in enumerate(final.data.vertices):
        v.select = in_loop(vi)
    for e in final.data.edges:
        e.select = in_loop(e.vertices[0]) and in_loop(e.vertices[1])