code: def _get_count_pagination(self, base, oldest_neighbor, newest_neighbor):
          
  
          count = self.spec['count']
  
          out_spec = {**base, 'count': count, 'order': self._order_by}
  
          if self._order_by == 'newest':
              older_view = View({**out_spec,
                                 'last': oldest_neighbor}) if oldest_neighbor else None
  
              newer_count = View({**base,
                                  'first': newest_neighbor,
                                  'order': 'oldest',
                                  'count': count}) if newest_neighbor else None
              newer_view = View({**out_spec,
                                 'last': newer_count.last}) if newer_count else None
  
              return older_view, newer_view
  
          if self._order_by == 'oldest':
              older_count = View({**base,
                                  'last': oldest_neighbor,
                                  'order': 'newest',
                                  'count': count}) if oldest_neighbor else None
              older_view = View({**out_spec,
                                 'first': older_count.last}) if older_count else None
  
              newer_view = View({**out_spec,
                                 'first': newest_neighbor}) if newest_neighbor else None
  
              return older_view, newer_view
  
          return None, None
docs: Compute the pagination for count-based views