def only_once(fn):

    once = [fn]

    def go(*arg, **kw):
        if once:
            once_fn = once.pop()
            return once_fn(*arg, **kw)

    return go
Decorate the given function to be a no-op after it is called exactly
dataset/ETHPy150Open goFrendiAsgard/kokoropy/kokoropy/packages/sqlalchemy/util/langhelpers.py/only_once