def static_var(variable_name, initial_value):
    # pylint: disable=line-too-long
    """Decorator that assigns a static variable to the decorated function.

    Credits: Claudiu https://stackoverflow.com/questions/279561/what-is-the-python-equivalent-of-static-variables-inside-a-function
    """
    def decorator(func):
        setattr(func, variable_name, initial_value)
        return func
    return decorator