def _register(event, handler):
    k = handler.__name__
    setattr(cp.tools, k, cp.Tool(event, handler))
    cp.config.update({"tools.%s.on" % k: True})
Registers the given event handler (e.g., "on_end_request").
dataset/ETHPy150Open clips/pattern/pattern/server/__init__.py/_register