def METHOD_NAME(bm_verts, v_layer, by_edges=False, e_layer=None, by_faces=False, f_layer=None):
    # walk over vertices by edges or faces and mark them
    if not ((by_edges and e_layer) or (by_faces and f_layer)):
        raise ValueError("Pick edges or faces for filling index values of vertices")
    if by_edges and e_layer:
        for vert in bm_verts:
            for edge in vert.link_edges:
                vert[v_layer] = edge[e_layer]
                break
    elif by_faces and f_layer:
        for vert in bm_verts:
            for face in vert.link_faces:
                vert[v_layer] = face[f_layer]
                break