Returns the paginator's pages without prematurely closing the active page.
428162
def pages(self):
        
        # protected access has to be permitted here to not close the paginator's pages

        # pylint: disable=protected-access
        paginator_pages = list(self.paginator._pages)
        if len(self.paginator._current_page) > 1:
            paginator_pages.append('\n'.join(self.paginator._current_page) + '\n' + (self.paginator.suffix or ''))
        # pylint: enable=protected-access

        return paginator_pages
237163
public function getPages()
    {
        $pages = [];

        foreach ($this->getLowers() as $lower) {
            $pages[$lower] = Pagination::LOWER;
        }

        if ($this->getCurrent()) {
            $pages[$this->getCurrent()] = Pagination::CURRENT;
        }

        foreach ($this->getHighers() as $higher) {
            $pages[$higher] = Pagination::HIGHER;
        }

        ksort($pages);

        return $pages;
    }
697793
def get_index_pages(original_url, pagination_index, pagination_interval, options={})
      resps = []
      prev_url = nil
      while resps.empty? || !resps.last.empty?
        next_url = self.next_index_page_url(original_url, pagination_index)
        break if next_url.empty?
        
        next_url = resolve_url(next_url, original_url)
        break if next_url == prev_url

        next_resp = self.get_page(next_url, @index_debug, options).to_s
        prev_url = next_url
        pagination_index += pagination_interval
        resps << next_resp
      end
      resps
    end
823481
def paginator(context, adjacent_pages=2):
    
    current_page = context.get('page')
    paginator    = context.get('paginator')
    if not paginator:
        return
    pages        = paginator.num_pages
    current_range = range(current_page - adjacent_pages, current_page + adjacent_pages + 1)
    page_numbers = [n for n in current_range if n > 0 and n <= pages]
    slugtype = ''

    if 'topic_slug' in context:
        page_url = context["topic"].get_short_url()
        slugtype = 'topic'
    elif 'forum_slug' in context:
        page_url = '/forum/%s/' % context["forum_slug"]
        slugtype = 'forum'
    else:
        page_url = context['request'].get_full_path()

    return {
        "is_paginated": context["is_paginated"],
        "page": current_page,
        "pages": pages,
        "page_obj": context['page_obj'],
        "page_numbers": page_numbers,
        "has_next": context["page_obj"].has_next(),
        "has_previous": context["page_obj"].has_previous(),
        "page_url" : page_url,
        'slugtype' : slugtype,
    }
312781
private function getPagesSeeds()
    {
        return [
            [
                'name'        => 'Pages - List all pages',
                'description' => 'Allow to list all pages.',
                'slug'        => PagesPolicy::PERMISSION_LIST,
            ],
            [
                'name'        => 'Pages - View a page',
                'description' => 'Allow to display a page.',
                'slug'        => PagesPolicy::PERMISSION_SHOW,
            ],
            [
                'name'        => 'Pages - Create a page',
                'description' => 'Allow to create a page.',
                'slug'        => PagesPolicy::PERMISSION_CREATE,
            ],
            [
                'name'        => 'Pages - Update a page',
                'description' => 'Allow to update a page.',
                'slug'        => PagesPolicy::PERMISSION_UPDATE,
            ],
            [
                'name'        => 'Pages - Delete a page',
                'description' => 'Allow to delete a page.',
                'slug'        => PagesPolicy::PERMISSION_DELETE,
            ],
        ];
    }
1254589
def pagination_for(context, current_page, page_var="page", exclude_vars=""):
    
    querystring = context["request"].GET.copy()
    exclude_vars = [v for v in exclude_vars.split(",") if v] + [page_var]
    for exclude_var in exclude_vars:
        if exclude_var in querystring:
            del querystring[exclude_var]
    querystring = querystring.urlencode()
    return {
        "current_page": current_page,
        "querystring": querystring,
        "page_var": page_var,
    }
1223679
public function getPages(Paginator $paginator, $pageRange = null)
    {
        $pageRange  = $paginator->getPageRange();
        $pageNumber = $paginator->getCurrentPageNumber();

        $originalPageRange = $pageRange;
        $pageRange         = $pageRange * 2 - 1;

        if ($originalPageRange + $pageNumber - 1 < $pageRange) {
            $pageRange = $originalPageRange + $pageNumber - 1;
        } elseif ($originalPageRange + $pageNumber - 1 > count($paginator)) {
            $pageRange = $originalPageRange + count($paginator) - $pageNumber;
        }

        return parent::getPages($paginator, $pageRange);
    }
408551
public function getVisitedPages()
    {
        $dates = $this->getStartEndDate();

        $items = LaravelAnalytics::getMostVisitedPagesForPeriod($dates['start'], $dates['end']);

        return $items;
    }
259329
public Map<Integer, String> getPageLinks() {

        Map<Integer, String> links = new TreeMap<Integer, String>();
        if (m_pageCount <= 1) {
            return links;
        }
        int startIndex, endIndex;
        String link = m_cms.getRequestContext().getUri() + m_parameters.toQueryString() + "&searchPage=";
        if (getDisplayPages() < 1) {
            // number of displayed pages not limited, build a map with all available page links
            startIndex = 1;
            endIndex = m_pageCount;
        } else {
            // limited number of displayed pages, calculate page range
            int currentPage = getSearchPage();
            int countBeforeCurrent = getDisplayPages() / 2;
            int countAfterCurrent;
            if ((currentPage - countBeforeCurrent) < 1) {
                // set count before to number of available pages
                countBeforeCurrent = currentPage - 1;
            }
            // set count after to number of remaining pages (- 1 for current page)
            countAfterCurrent = getDisplayPages() - countBeforeCurrent - 1;
            // calculate start and end index
            startIndex = currentPage - countBeforeCurrent;
            endIndex = currentPage + countAfterCurrent;
            // check end index
            if (endIndex > m_pageCount) {
                int delta = endIndex - m_pageCount;
                // decrease start index with delta to get the right number of displayed pages
                startIndex -= delta;
                // check start index to avoid values < 1
                if (startIndex < 1) {
                    startIndex = 1;
                }
                endIndex = m_pageCount;
            }
        }

        // build the sorted tree map of page links
        for (int i = startIndex; i <= endIndex; i++) {
            links.put(new Integer(i), (link + i));
        }
        return links;
    }
1138728
def pages(self):
        """"""
        rev = self.db.get('site:rev')
        if int(rev) != self.revision:
            self.reload_site()

        return self._pages
908509
protected function getPages()
    {
        $pages = $this->pages;
        ksort($pages);
        $pages = array_values($pages);

        return $pages;
    }
555894
public Iterator<Page> getSortedPages()
    {
        return new AbstractIterator<Page>()
        {
            private int currentPosition;
            private final PageBuilder pageBuilder = new PageBuilder(types);
            private final int[] outputChannels = new int[types.size()];

            {
                Arrays.setAll(outputChannels, IntUnaryOperator.identity());
            }

            @Override
            public Page computeNext()
            {
                currentPosition = buildPage(currentPosition, outputChannels, pageBuilder);
                if (pageBuilder.isEmpty()) {
                    return endOfData();
                }
                Page page = pageBuilder.build();
                pageBuilder.reset();
                return page;
            }
        };
    }
811794
function(options) {
        var pages = [];
        var fromPage = options.page - 2;
        if (fromPage < 2) {
          fromPage = 2;
        }
        for (var page = fromPage; (page < (fromPage + options.shown)); page++) {
          pages.push(page);
        }
        return pages;
      }
1030430
public List<Integer> getPageRange() {
        List<Integer> r = new ArrayList<Integer>();
        for (int i = 1; i <= getPages(); i++) {
            r.add(i);
        }
        return r;
    }
854109
def get_paging(self):
        
        orig_page_num = self.page_num
        orig_page_size = self.page_size

        try:

            page_num = int(self.request.GET.get(self.page_kwarg or 'p'))

            if page_num < 1:
                page_num = orig_page_num
        except:
            page_num = orig_page_num

        try:
            orig_page_size = self.page_size
            page_size = int(self.request.GET.get(self.page_size_kwarg or 'ps'))

            if page_size < 1:
                page_size = orig_page_size
        except:
            page_size = orig_page_size

        return page_num, page_size
598157
public function getPages()
    {
        $pages = array();

        foreach ($this->children as $child) {
            if ($child instanceof SwatNoteBookChild) {
                $pages = array_merge($pages, $child->getPages());
            }
        }

        return $pages;
    }
22333
public function Pages()
    {
        $pages = SiteTree::get();
        $types = $this->PageTypes->getValue();
        if (count($types)) {
            $pages = $pages->filter('ClassName', $types);
        }

        $parents = $this->PageParents()->column('ID');
        if (count($parents)) {
            $pages = $pages->filter('ParentID', $parents);
        }

        return $pages;
    }