Get current page.

        :return int: page number
168237
def page(self):
        
        if not self._page:
            try:
                self._page = self.paginator.page(
                    self.query_dict.get('page', 1))
            except InvalidPage:
                raise HttpError("Invalid page", status=HTTP_400_BAD_REQUEST)
        return self._page
608637
public function getActPage()
    {
        $lastPage = $this->getPagesCount();
        $currentPage = parent::getActPage();

        if ($currentPage >= $lastPage) {
            $currentPage = $lastPage - 1;
        }

        return $currentPage;
    }
669930
def pages_counter(self, total: int, page_size: int = 100) -> int:
        
        if total <= page_size:
            count_pages = 1
        else:
            if (total % page_size) == 0:
                count_pages = total / page_size
            else:
                count_pages = (total / page_size) + 1
        # method ending
        return int(count_pages)
1285228
private function _currentPage(): int
    {
        $currentPage = Craft::$app->getRequest()->getQueryParam($this->pageParam, 1);

        if (is_numeric($currentPage) && $currentPage > $this->totalPages) {
            $currentPage = $this->totalPages > 0 ? $this->totalPages : 1;
        } else if (!is_numeric($currentPage) || $currentPage < 0) {
            $currentPage = 1;
        }

        return (int)$currentPage;
    }
137281
def get_total_pages(self):
        

        if self.total_elements is None or self.page_size is None:
            return None

        return math.ceil(float(self.total_elements) / float(self.page_size))
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
10647
public function getCurrentPageNumber()
    {
        $request = $this->getRequest();

        $optionsRenderer = $this->getOptionsRenderer();
        $parameterNames = $optionsRenderer['parameterNames'];
        if ($request->getParam($parameterNames['currentPage']) != '') {
            return (int) $request->getParam($parameterNames['currentPage']);
        }

        return (int) 1;
    }
972744
public int getCurrentPageSize() {
        if (buffer.isEmpty()) return OggPage.getMinimumPageSize();

        OggPage p = buffer.get( buffer.size()-1 );
        return p.getPageSize();
    }
994675
def has_next_page(self):
        
        return self.current_page < math.ceil(self.total_count / self.per_page)
283945
def num_pages(self):
        

        if self.count == 0 and not self.allow_empty_first_page:
            return 0

        hits = max(1, self.count - self.orphans)

        return int(ceil(hits / float(self.per_page)))
64750
def pages(self):
        
        url = self._build_url('pages', base_url=self._api)
        json = self._json(self._get(url), 200)
        return PagesInfo(json) if json else None
659318
def pageview(self, cur_p=''):
        '''
        
        '''

        if cur_p == '':
            current_page_number = 1
        else:
            current_page_number = int(cur_p)

        current_page_number = 1 if current_page_number < 1 else current_page_number

        pager_num = int(MLog.total_number() / CMS_CFG['list_num'])

        kwd = {
            'pager': '',
            'title': '',
            'current_page': current_page_number,
        }
        arr_num = []
        postinfo = MLog.query_all_current_url()

        for i in postinfo:
            postnum = MLog.count_of_current_url(i.current_url)
            arr_num.append(postnum)

        self.render('misc/log/pageview.html',
                    kwd=kwd,
                    infos=MLog.query_all_pageview(current_page_num=current_page_number),
                    postinfo=postinfo,
                    arr_num=arr_num,
                    format_date=tools.format_date,
                    userinfo=self.userinfo)
1344426
def prev(self):
        

        if self.total:
            if self.offset - self.limit - self.limit < 0:
                return self.first
            else:
                offset = self.offset - self.limit
                return {'page[offset]': offset, 'page[limit]': self.limit}
        else:
            return None
553703
def currentVersion(self):
        
        if self._currentVersion is None:
            self.__init(self._url)
        return self._currentVersion
947697
def previous(self):
        
        if self._page.has_previous():
            return self._endless_page(
                self._page.previous_page_number(),
                label=settings.PREVIOUS_LABEL)
        return ''
1186794
public function current()
    {
        // Getting the first page
        if ($this->currentPage === null) {
            $data = $this->api->searchWithBody($this->body);
            if (isset($data['next_page_token'])) {
                $this->nextPage = $data['next_page_token'];
            }

            return $data;
        }

        // Getting another page
        $body = array_merge($this->body, ['pagetoken' => $this->currentPage]);
        $data = $this->api->searchWithBody($body);
        if (isset($data['next_page_token'])) {
            $this->nextPage = $data['next_page_token'];
        } else {
            $this->nextPage = null;
        }

        return $data;
    }
204170
def get_page(n)
            raise IndexError, "Page numbers are referenced starting from 1" if n < 1
            raise IndexError, "Page not found" if n > self.Count.to_i

            self.each_page.lazy.drop(n - 1).first or raise IndexError, "Page not found"
        end