def METHOD_NAME(seed=None):
    """**Turn seed into a random number generator**
    Parameters
    ----------
    seed : None, int, numpy.random.RandomState or numpy.random.Generator
        Seed for the random number generator. If seed is None, a numpy.random.Generator is created with fresh,
        unpredictable entropy. If seed is an int, a new numpy.random.RandomState instance is created, seeded with
        seed. If seed is already a Generator or RandomState instance then that instance is used.
        The manin difference between the legacy RandomState class and the new Generator class is that the former
        has better reproducibililty and compatibililty guarantees (it is effectively frozen from NumPy v1.16)
        while the latter has better statistical "randomness" properties and lower computational cost.
        See: https://numpy.org/doc/stable/reference/random/legacy.html for further information.
        Note: to initialise the new Generator class with an integer seed, use, e.g.:
        ``check_random_state(np.random.SeedSequence(123))``.
    Returns
    -------
    rng: numpy.random.Generator or numpy.random.RandomState
        Random number generator.
    """
    # If seed is an integer, use the legacy RandomState class
    if isinstance(seed, numbers.Integral):
        return np.random.RandomState(seed)
    # If seed is already a random number generator class return it as it is
    if isinstance(seed, (np.random.Generator, np.random.RandomState)):
        return seed
    # If seed is something else, use the new Generator class
    return np.random.default_rng(seed)