libb.repeat

repeat(x_times=2)[source]

Decorator to repeat a function multiple times.

Parameters:

x_times (int) – Number of times to repeat (default: 2).

Returns:

Decorator function.

Example:

>>> @repeat(3)
... def printme():
...    print('Foo')
...    return 'Bar'
>>> printme()
Foo
Foo
Foo
'Bar'