def register(func, *targs, **kargs):
    if hasattr(atexit, "unregister"):
        atexit.register(func, *targs, **kargs)
    else:
        _exithandlers.append((func, targs, kargs))
    return func
register a function to be executed upon normal program termination
dataset/ETHPy150Open python-zk/kazoo/kazoo/python2atexit.py/register