def randomizable(function):
    """
    A decorator which randomizes requests if needed
    """
    @functools.wraps(function)
    def wrapper(self, *args, **kwargs):
        if self.randomize:
            self.randomize_headers()
        return function(self, *args, **kwargs)
    return wrapper
def randomizable ( function ) : @ functools . wraps ( function ) def wrapper ( self , * args , ** kwargs ) : if self . randomize : self . randomize_headers ( ) return function ( self , * args , ** kwargs ) return wrapper
A decorator which randomizes requests if needed