code: def _build_callback(self, config):
          ''' Apply plugins to a route and return a new callable. '''
          wrapped = config['callback']
          plugins = self.plugins + config['apply']
          skip    = config['skip']
          try:
              for plugin in reversed(plugins):
                  if True in skip: break
                  if plugin in skip or type(plugin) in skip: continue
                  if getattr(plugin, 'name', True) in skip: continue
                  if hasattr(plugin, 'apply'):
                      wrapped = plugin.apply(wrapped, config)
                  else:
                      wrapped = plugin(wrapped)
                  if not wrapped: break
                  functools.update_wrapper(wrapped, config['callback'])
              return wrapped
          except RouteReset: # A plugin may have changed the config dict inplace.
              return self._build_callback(configf _build_callback(self, config):
          ''' Apply plugins to a route and return a new callable. '''
          wrapped = config['callback']
          plugins = self.plugins + config['apply']
          skip    = config['skip']
          try:
              for plugin in reversed(plugins):
                  if True in skip: break
                  if plugin in skip or type(plugin) in skip: continue
                  if getattr(plugin, 'name', True) in skip: continue
                  if hasattr(plugin, 'apply'):
                      wrapped = plugin.apply(wrapped, config)
                  else:
                      wrapped = plugin(wrapped)
                  if not wrapped: break
                  functools.update_wrapper(wrapped, config['callback'])
              return wrapped
          except RouteReset: # A plugin may have changed the config dict inplace.
              return self._build_callback(config)
docs: Apply plugins to a route and return a new callable.