def _setup(self):
        hooks = cherrypy.serving.request.hooks

        conf = self._merged_args()

        p = conf.pop("priority", None)
        if p is None:
            p = getattr(self.callable, "priority", self._priority)

        hooks.attach(self._point, self.callable, priority=p, **conf)

        locking = conf.pop('locking', 'implicit')
        if locking == 'implicit':
            hooks.attach('before_handler', self._lock_session)
        elif locking == 'early':
            # Lock before the request body (but after _sessions.init runs!)
            hooks.attach('before_request_body', self._lock_session,
                         priority=60)
        else:
            # Don't lock
            pass

        hooks.attach('before_finalize', _sessions.save)
        hooks.attach('on_end_request', _sessions.close)
Ignores everything between ``{% comment %}`` and ``{% endcomment %}``.
dataset/ETHPy150Open clips/pattern/pattern/server/cherrypy/cherrypy/_cptools.py/SessionTool._setup--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/_internal/django/template/defaulttags.py/comment