def randomization_warning_decorator()

in spotify_confidence/analysis/bayesian/bayesian_base.py [0:0]


def randomization_warning_decorator(f):
    """Set numpy randomization seed and warn users if not fixed.

    Note to developers:
    Do not compare random variables that have been
    sampled from the same seed. It will lead to incorrect results.
    To avoid this situation it's best to apply this decorator to
    public methods that involve randomization.
    """

    @wraps(f)
    def wrapper(*args, **kwargs):
        option_seed = options.get_option("randomization_seed")
        np_seed = INITIAL_RANDOMIZATION_SEED
        if option_seed != np_seed and option_seed is None:
            randomization_warning_message = """