Gets a paginated list of indicators that the user's company has whitelisted.

        :param int page_number: the page number to get.
        :param int page_size: the size of the page to be returned.
        :return: A |Page| of |Indicator| objects.
556583
def get_whitelist_page(self, page_number=None, page_size=None):
        

        params = {
            'pageNumber': page_number,
            'pageSize': page_size
        }
        resp = self._client.get("whitelist", params=params)
        return Page.from_dict(resp.json(), content_type=Indicator)
212953
def get_supplier_properties_per_page(self, per_page=1000, page=1, params=None):
        
        return self._get_resource_per_page(resource=SUPPLIER_PROPERTIES, per_page=per_page, page=page, params=params)
961735
def get_pages_from_id_list(id_list):
    '''
    
    '''
    page_list = []
    for id_ in id_list:
        try:
            page_list.append(
                Page.objects.get(id=id_).specific)
        except ObjectDoesNotExist:
            logging.error(
                "Attempted to fetch non-existent"
                " page with id of {}".format(id_))
    return page_list
1026027
def paginate(objects, page_num, per_page, max_paging_links):
    
    if not per_page:
        return Paginator(objects, 0)
    paginator = Paginator(objects, per_page)
    try:
        page_num = int(page_num)
    except ValueError:
        page_num = 1
    try:
        objects = paginator.page(page_num)
    except (EmptyPage, InvalidPage):
        objects = paginator.page(paginator.num_pages)
    page_range = objects.paginator.page_range
    if len(page_range) > max_paging_links:
        start = min(objects.paginator.num_pages - max_paging_links,
            max(0, objects.number - (max_paging_links // 2) - 1))
        page_range = list(page_range)[start:start + max_paging_links]
    objects.visible_page_range = page_range
    return objects
959652
public function getApiApps($page = 1, $page_size = 20)
    {
        $response = $this->rest->get(static::APIAPP_LIST_PATH, array('page' => $page, 'page_size' => $page_size));

        $this->checkResponse($response);

        $list = new ApiAppList($response);

        if ($page > $list->getNumPages()) {
            throw new Error('page_not_found', 'Page not found');
        }

        return $list;
    }
1093537
def get_by_page(query, page, page_size):
    
    pager = Paginator(query, page_size)

    try:
        models = pager.page(page)
    except PageNotAnInteger:
        # If page is not an integer, deliver first page.
        models = pager.page(1)
    except EmptyPage:
        # If page is out of range (e.g. 9999), deliver last page of results.
        models = pager.page(pager.num_pages)

    return models
42590
def list(self, page=1, per_page=50):
        
        data = {"page": page,
                "per_page": per_page}
        return self.get(self.base_url, data=data)
738284
def get_page_numbers(
        current_page, num_pages,
        extremes=DEFAULT_CALLABLE_EXTREMES,
        arounds=DEFAULT_CALLABLE_AROUNDS,
        arrows=DEFAULT_CALLABLE_ARROWS):
    
    page_range = range(1, num_pages + 1)
    pages = []
    if current_page != 1:
        if arrows:
            pages.append('first')
        pages.append('previous')

    # Get first and last pages (extremes).
    first = page_range[:extremes]
    pages.extend(first)
    last = page_range[-extremes:]

    # Get the current pages (arounds).
    current_start = current_page - 1 - arounds
    if current_start < 0:
        current_start = 0
    current_end = current_page + arounds
    if current_end > num_pages:
        current_end = num_pages
    current = page_range[current_start:current_end]

    # Mix first with current pages.
    to_add = current
    if extremes:
        diff = current[0] - first[-1]
        if diff > 1:
            pages.append(None)
        elif diff < 1:
            to_add = current[abs(diff) + 1:]
    pages.extend(to_add)

    # Mix current with last pages.
    if extremes:
        diff = last[0] - current[-1]
        to_add = last
        if diff > 1:
            pages.append(None)
        elif diff < 1:
            to_add = last[abs(diff) + 1:]
        pages.extend(to_add)

    if current_page != num_pages:
        pages.append('next')
        if arrows:
            pages.append('last')
    return pages
827756
public PaginatedList<CompanyDomain> listDomains(int page) {
		PaginatedList<CompanyDomain> results = new PaginatedList<CompanyDomain>();
		Criteria criteria = this.dao.newCriteria(CompanyDomain.class)
				.createAlias("company", "company", JoinType.INNER_JOIN)
				.addOrder(Order.asc("company.name")).addOrder(Order.asc("host"));
		if (page > 0)
			criteria.setFirstResult((page-1) * PAGESIZE).setMaxResults(PAGESIZE);
		Criteria counting = this.dao.newCriteria(CompanyDomain.class).setProjection(Projections.countDistinct("id"));
		results.setList(this.dao.findByCriteria(criteria, CompanyDomain.class));
		results.setTotal((Long) counting.uniqueResult());
		return results;
	}
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
835318
protected List<Integer> getPageSizes() {

        try {
            return Collections.singletonList(Integer.valueOf(m_configObject.getInt(JSON_KEY_PAGESIZE)));
        } catch (JSONException e) {
            List<Integer> result = null;
            String pageSizesString = null;
            try {
                pageSizesString = m_configObject.getString(JSON_KEY_PAGESIZE);
                String[] pageSizesArray = pageSizesString.split("-");
                if (pageSizesArray.length > 0) {
                    result = new ArrayList<>(pageSizesArray.length);
                    for (int i = 0; i < pageSizesArray.length; i++) {
                        result.add(Integer.valueOf(pageSizesArray[i]));
                    }
                }
                return result;
            } catch (NumberFormatException | JSONException e1) {
                LOG.warn(Messages.get().getBundle().key(Messages.LOG_PARSING_PAGE_SIZES_FAILED_1, pageSizesString), e);
            }
            if (null == m_baseConfig) {
                if (LOG.isInfoEnabled()) {
                    LOG.info(Messages.get().getBundle().key(Messages.LOG_NO_PAGESIZE_SPECIFIED_0), e);
                }
                return null;
            } else {
                return m_baseConfig.getPaginationConfig().getPageSizes();
            }
        }
    }
321076
def list_space_systems(self, page_size=None):
        
        params = {}

        if page_size is not None:
            params['limit'] = page_size

        return pagination.Iterator(
            client=self._client,
            path='/mdb/{}/space-systems'.format(self._instance),
            params=params,
            response_class=mdb_pb2.ListSpaceSystemsResponse,
            items_key='spaceSystem',
            item_mapper=SpaceSystem,
        )
702853
def get_pages(self, label=None):
        """"""
        return (
            page for page in sorted(
                self._pages.values(), key=lambda i: i.created, reverse=True
            ) if ((not label or label in page.labels) and page.visible)
        )
1046908
def count(self, page_size=10, vtimeout=10, callback=None):
        
        def counted(a):
            if callable(callback):
                callback(int(a['ApproximateNumberOfMessages']))
        self.get_attributes('ApproximateNumberOfMessages', callback=counted)
547752
def get_tags_of_supplier_per_page(self, supplier_id, per_page=1000, page=1):
        
        return self._get_resource_per_page(
            resource=SUPPLIER_TAGS,
            per_page=per_page,
            page=page,
            params={'supplier_id': supplier_id},
        )
503531
def availablePageSizes(self):
		

		sizes = [x for x in dir(QPagedPaintDevice)
		         if type(getattr(QPagedPaintDevice, x)) == QPagedPaintDevice.PageSize]
		return sizes
816286
def pagination(page, limit, length):
        
        realpage = page
        page = page or CtsCapitainsLocalResolver.DEFAULT_PAGE
        limit = limit or CtsCapitainsLocalResolver.PER_PAGE[1]

        if limit < CtsCapitainsLocalResolver.PER_PAGE[0] or limit > CtsCapitainsLocalResolver.PER_PAGE[2]:
            limit = CtsCapitainsLocalResolver.PER_PAGE[1]

        page = (page - 1) * limit

        if page > length:
            realpage = int(ceil(length / limit))
            page = limit * (realpage - 1)
            count = length - 1
        elif limit - 1 + page < length:
            count = limit - 1 + page
        else:
            count = length - 1

        return page, count + 1, realpage, count - page + 1