def run_once(f):
@wraps(f)<EOL>def wrapper(*args, **kwargs):<EOL><INDENT>if not wrapper.has_run:<EOL><INDENT>result = f(*args, **kwargs)<EOL>wrapper.has_run = True<EOL>return result<EOL><DEDENT><DEDENT>wrapper.has_run = False<EOL>return wrapper<EOL>
Runs a function (successfully) only once.
    The running can be reset by setting the `has_run` attribute to False