import random


in_percentage = lambda x: random.randint(1,100) <= x


"""
They've done studies, you know. 50% of the time,
it works every time.
"""
def sometimes(fn):
    
    def wrapped(*args, **kwargs):
        wrapped.x += 1
        if wrapped.x % 2 == 1:
            return fn(*args, **kwargs)
        return
    
    wrapped.x = 0
    return wrapped


"""
Has a 50/50 chance of calling a function
"""
def sometimesish(fn):

    def wrapped(*args, **kwargs):
        if random.randint(1,2) == 1:
            return fn(*args, **kwargs)
        return
    
    return wrapped


"""
Function has a X percentage chance of running
"""
def percent_of_the_time(p):
    
    def decorator(fn):
        
        def wrapped(*args, **kwargs):
            if in_percentage(p):
                fn(*args, **kwargs)
            return
        
        return wrapped
        
    return decorator


"""
Do something a random amount of times
between x & y
"""
def times(x,y):
    
    def decorator(fn):
        
        def wrapped(*args, **kwargs):
            while wrapped.min <= wrapped.max:
                wrapped.min += 1
                fn(*args, **kwargs)
            return

        wrapped.min = x
        wrapped.max = random.randint(x,y)
        
        return wrapped
    
    return decorator
@@ -293,36 +293,21 @@
 kwargs)%0A
-        return%0A
     %0A
+
     wrap
@@ -332,24 +332,51 @@
 rn wrapped%0A%0A
+half_the_time = sometimes%0A%0A
 %0A%22%22%22%0AHas a 5
@@ -546,31 +546,16 @@
 kwargs)%0A
-        return%0A
     %0A   
@@ -798,35 +798,16 @@
 kwargs)%0A
-            return%0A
         
@@ -861,16 +861,347 @@
 orator%0A%0A
+%22%22%22%0AOnly 5%25 chance of happening%0A%22%22%22%0Adef rarely(fn):%0A    def wrapped(*args, **kwargs):%0A        if in_percentage(5):%0A            fn(*args, **kwargs)%0A    return wrapped%0A%0A%22%22%22%0A95%25 chance of happening%0A%22%22%22%0Adef mostly(fn):%0A    def wrapped(*args, **kwargs):%0A        if in_percentage(95):%0A            fn(*args, **kwargs)%0A    return wrapped%0A%0A
 %0A%22%22%22%0ADo 
@@ -1419,24 +1419,24 @@
 ed.min += 1%0A
+
             
@@ -1458,35 +1458,16 @@
 *kwargs)
-%0A            return
 %0A%0A      

Add rarely, mostly and other alias