Function has a X percentage chance of running

def percent_of_the_time(p):
    """
    Function has a X percentage chance of running
    """
    def decorator(fn):

        def wrapped(*args, **kwargs):
            if in_percentage(p):
                fn(*args, **kwargs)

        return wrapped

    return decorator