def metis_perm(g, k):
    r"""Return nodes permutation according to ``'metis'`` algorithm.

    For internal use.

    Parameters
    ----------
    g : DGLGraph
        The homogeneous graph.
    k: int
        The partition parts number.

    Returns
    -------
    iterable[int]
        The nodes permutation.
    """
    pids = metis_partition_assignment(
        g if g.device == F.cpu() else g.to(F.cpu()), k
    )
    pids = F.asnumpy(pids)
    return np.argsort(pids).copy()
Return nodes permutation according to ``'metis'`` algorithm.

    For internal use.

    Parameters
    ----------
    g : DGLGraph
        The homogeneous graph.
    k: int
        The partition parts number.

    Returns
    -------
    iterable[int]
        The nodes permutation.
    
python/dgl/transforms/functional.py