human
Give me a the Python code you requested given the following:
I am working on the file "Closure a dekorator.ipynb".
The first task is:
Teraz si mozeme vyrobit napriklad uplne vseobecny dekorator, ktory bude pocitat pocty volani nejakej funkcie
Can you write Python code for it?
assistant
#Here is the Python code you requested.

def counter_decorator(fct):
    counter = 0
    def wrapper(*args, **kwargs):
        nonlocal counter
        counter += 1
        return fct(*args, **kwargs)
    return wrapper

@counter_decorator
def counted_fib(n):
    if n == 0:
        return 0
    elif n == 1:
        return 1
    else:
        return counted_fib(n-1) + counted_fib(n-2)
    
counted_fib(10)
print(counted_fib.__closure__[0].cell_contents)