def addHook(hook, func):
 if (not _hooks.get(hook, None)):
  _hooks[hook] = []
 if (func not in _hooks[hook]):
  _hooks[hook].append(func)

def addHook ( hook , func ) : if ( not _hooks . get ( hook , None ) ) : _hooks [ hook ] = [ ] if ( func not in _hooks [ hook ] ) : _hooks [ hook ] . append ( func )
add a function to hook .