code: def register(self, func, order):
          
          token = self.Token()
          self._filter_order.append((order, token, func))
          self._filter_order.sort(key=lambda x: x[0])
          return token
docs: Add a function to the filter chain.
  
          :param func: A callable which is to be added to the filter chain.
          :param order: An object indicating the ordering of the function
                        relative to the others.
          :return: Token representing the registration.
  
          Register the function `func` as a filter into the chain. `order` must
          be a value which is used as a sorting key to order the functions
          registered in the chain.
  
          The type of `order` depends on the use of the filter, as does the
          number of arguments and keyword arguments which `func` must accept.
          This will generally be documented at the place where the
          :class:`Filter` is used.
  
          Functions with the same order are sorted in the order of their
          addition, with the function which was added earliest first.
  
          Remember that all values passed to `order` which are registered at the
          same time in the same :class:`Filter` need to be totally orderable with
          respect to each other.
  
          The returned token can be used to :meth:`unregister` a filter.