def static_vars(**kwargs):
    """Decorator to create static variables for a function

    Usage:
    ```python
    @static_vars(i = 0)
    def function(x):
        i += 1
        return x + i

    function(0) # 1
    function(0) # 2
    function(10) # 13
    ```
    """
    def decorate(func):
        for k in kwargs:
            setattr(func, k, kwargs[k])
        return func

    return decorate