def _only_once(f):
    """decorator to only run a function once"""
    f.called = False
    def wrapped(**kwargs):
        if f.called:
            return
        ret = f(**kwargs)
        f.called = True
        return ret
    return wrapped