# Path: dppy/utils.py
# def check_random_state(seed: object) -> np.random.RandomState:
#     """Turn seed into a np.random.RandomState instance
#     Parameters
#     ----------
#     seed : None | int | instance of RandomState
#         If seed is None, return the RandomState singleton used by np.random.
#         If seed is an int, return a new RandomState instance seeded with seed.
#         If seed is already a RandomState instance, return it.
#         Otherwise raise ValueError.
# 
#     Returns
#     -------
#     np.random.RandomState
# 
#     .. seealso::
# 
#         `Scikit learn source code <https://github.com/scikit-learn/scikit-learn/blob/7813f7efb/sklearn/utils/validation.py#L763>`_
#     """
#     if seed is None or seed is np.random:
#         return np.random.mtrand._rand
#     if isinstance(seed, (int, np.integer)):
#         return np.random.RandomState(seed)
#     if isinstance(seed, np.random.RandomState):
#         return seed
#     raise ValueError('%r cannot be used to seed a numpy.random.RandomState'
#                      ' instance' % seed)


import functools  # used for decorators to pass docstring
import numpy as np
        import networkx as nx
        import networkx as nx
from itertools import chain  # create graph edges from path
from bisect import bisect_right  # for RSK
from dppy.utils import check_random_state

- Descent procresses :class:`Descent`:

    * :func:`uniform_permutation`

- :class:`PoissonizedPlancherel` measure

    * :func:`uniform_permutation`
    * :func:`RSK`: Robinson-Schensted-Knuth correspondande
    * :func:`xy_young_ru` young diagram -> russian convention coordinates
    * :func:`limit_shape`

.. seealso:

    `Documentation on ReadTheDocs <https://dppy.readthedocs.io/en/latest/exotic_dpps/index.html>`_
"""




# For class PoissonizedPlancherel



def ust_sampler_wilson(list_of_neighbors, root=None,
                       random_state=None):
    try:
    except ImportError:
        raise ValueError('The networkx package is required to sample spanning trees (see setup.py).')


# Path: dppy/utils.py
# def check_random_state(seed: object) -> np.random.RandomState:
#     """Turn seed into a np.random.RandomState instance
#     Parameters
#     ----------
#     seed : None | int | instance of RandomState
#         If seed is None, return the RandomState singleton used by np.random.
#         If seed is an int, return a new RandomState instance seeded with seed.
#         If seed is already a RandomState instance, return it.
#         Otherwise raise ValueError.
# 
#     Returns
#     -------
#     np.random.RandomState
# 
#     .. seealso::
# 
#         `Scikit learn source code <https://github.com/scikit-learn/scikit-learn/blob/7813f7efb/sklearn/utils/validation.py#L763>`_
#     """
#     if seed is None or seed is np.random:
#         return np.random.mtrand._rand
#     if isinstance(seed, (int, np.integer)):
#         return np.random.RandomState(seed)
#     if isinstance(seed, np.random.RandomState):
#         return seed
#     raise ValueError('%r cannot be used to seed a numpy.random.RandomState'
#                      ' instance' % seed)


# Path: dppy/exotic_dpps_core.py
import functools  # used for decorators to pass docstring
import numpy as np
        import networkx as nx
        import networkx as nx
from itertools import chain  # create graph edges from path
from bisect import bisect_right  # for RSK
from dppy.utils import check_random_state


- Descent procresses :class:`Descent`:

    * :func:`uniform_permutation`

- :class:`PoissonizedPlancherel` measure

    * :func:`uniform_permutation`
    * :func:`RSK`: Robinson-Schensted-Knuth correspondande
    * :func:`xy_young_ru` young diagram -> russian convention coordinates
    * :func:`limit_shape`

.. seealso:

    `Documentation on ReadTheDocs <https://dppy.readthedocs.io/en/latest/exotic_dpps/index.html>`_
"""




# For class PoissonizedPlancherel



def ust_sampler_wilson(list_of_neighbors, root=None,
                       random_state=None):
    try:
    except ImportError:
        raise ValueError('The networkx package is required to sample spanning trees (see setup.py).')


    rng = check_random_state(random_state)