# Path: pactools/utils/validation.py
# def check_random_state(seed):
#     """Turn seed into a np.random.RandomState instance
# 
#     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.
#     """
#     if seed is None or seed is np.random:
#         return np.random.mtrand._rand
#     if isinstance(seed, (numbers.Integral, 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 numpy as np
from .validation import check_random_state



def almost_pink_noise(n_points, slope=1., plateau=0.05, random_state=None):
    """Generate some pink (1/f^slope) noise, with a plateau at low frequencies

    Parameters
    ----------
    n_points : integer
        Length of the noise signal

    slope : float
        The generated noise will have a (1/f^slope) energy

    plateau : float
        The frequencies will have the same energy between 0 and plateau
    """
    n_points = int(n_points)

# Path: pactools/utils/validation.py
# def check_random_state(seed):
#     """Turn seed into a np.random.RandomState instance
# 
#     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.
#     """
#     if seed is None or seed is np.random:
#         return np.random.mtrand._rand
#     if isinstance(seed, (numbers.Integral, 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: pactools/utils/pink_noise.py
import numpy as np
from .validation import check_random_state




def almost_pink_noise(n_points, slope=1., plateau=0.05, random_state=None):
    """Generate some pink (1/f^slope) noise, with a plateau at low frequencies

    Parameters
    ----------
    n_points : integer
        Length of the noise signal

    slope : float
        The generated noise will have a (1/f^slope) energy

    plateau : float
        The frequencies will have the same energy between 0 and plateau
    """
    n_points = int(n_points)

    rng = check_random_state(random_state)