def paginate(self, request, collection):
        """ Paginate collection.

        :return object: Collection or paginator

        """
        p = Paginator(request, self, collection)
        return p.paginator and p or UpdatedList(collection)
def paginate ( self , request , collection ) : p = Paginator ( request , self , collection ) return p . paginator and p or UpdatedList ( collection )
Paginate collection.

        :return object: Collection or paginator