code: def template_filter(self, param=None):
          
          def deco(func):
              name = param or func.__name__
              self.filters[name] = func
              return func
  
          return deco
docs: Returns a decorator that adds the wrapped function to dictionary of template filters.
  
          The wrapped function is keyed by either the supplied param (if supplied)
          or by the wrapped functions name.
  
          :param param: Optional name to use instead of the name of the function to be wrapped
          :return: A decorator to wrap a template filter function
          :rtype: callable