def counter(func):
i = [0, ]
def _f(*args):
i[0] += 1
print(i[0])
return func(*args)
return _f
@counter
def a(x):
return x
print(a('hey'))
print(a('hey'))
print(a('heuhe'))
print(a('dsds'))
ZGVmIGNvdW50ZXIoZnVuYyk6CiAgICBpID0gWzAsIF0KCiAgICBkZWYgX2YoKmFyZ3MpOgogICAgICAgIGlbMF0gKz0gMQogICAgICAgIHByaW50KGlbMF0pCiAgICAgICAgcmV0dXJuIGZ1bmMoKmFyZ3MpCgogICAgcmV0dXJuIF9mCgoKQGNvdW50ZXIKZGVmIGEoeCk6CiAgICByZXR1cm4geAoKCnByaW50KGEoJ2hleScpKQpwcmludChhKCdoZXknKSkKcHJpbnQoYSgnaGV1aGUnKSkKcHJpbnQoYSgnZHNkcycpKQ==