def METHOD_NAME(L, I, D):
    ret = np.zeros(I.shape)
    batch = 0
    i_idx = 0
    for length in L:
        for _ in range(length):
            ret[i_idx] = D[batch][I[i_idx]]
            i_idx += 1
        batch += 1
    return [ret]