def _static_vars_(**kwargs):
    """
    Adds static variables to a decorated function
    Code taken from https://stackoverflow.com/questions/279561/
    what-is-the-python-equivalent-of-static-variables-inside-a-function
    :param kwargs:
    :return:
    """
    def decorate(func):
        for k in kwargs:
            setattr(func, k, kwargs[k])
        return func
    return decorate