This method will return a list of records for a specific page.

@param pageNumber page number to return. This is indexed at 1, not 0. Any value below 1 is illegal and will
be rejected.
@return list of records that match a query make up a "page".
7631
public LazyList<T> getPage(int pageNumber) {

        if (pageNumber < 1) throw new IllegalArgumentException("minimum page index == 1");

        try {
            LazyList<T> list = find(query, params).offset((pageNumber - 1) * pageSize).limit(pageSize);
            if (orderBys != null) {
                list.orderBy(orderBys);
            }
            currentPageIndex = pageNumber;
            return list;
        } catch (Exception mustNeverHappen) {
            throw new InternalException(mustNeverHappen);
        }
    }
381521
public List<Entity> pageForEntityList(Entity where, Page page) throws SQLException {
		return page(where, page, EntityListHandler.create());
	}
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;
	}
766522
private function paginateRecords(ActiveQueryInterface $query, $pageNumber, $count)
    {
        $offset = ($pageNumber - 1) * $count;
        $limit = $count;

        return $query->offset($offset)->limit($limit);
    }
1191192
def query_all_pageview(current_page_num=1):
        '''
        
        '''
        return TabLog.select().distinct(TabLog.current_url).order_by(TabLog.current_url).paginate(
            current_page_num, CMS_CFG['list_num']
        )
787803
public static <E> Page<E> startPage(int pageNum, int pageSize, String orderBy) {
        Page<E> page = startPage(pageNum, pageSize);
        page.setOrderBy(orderBy);
        return page;
    }
968201
public @NotNull List<Page> getPages(@NotNull Predicate<Page> filter) {
    return getPages(filter, (Page)null);
  }
472148
def filter_pages(pages, pagenum, pagename):
    
    if pagenum:
        try:
            pages = [list(pages)[pagenum - 1]]
        except IndexError:
            raise IndexError('Invalid page number: %d' % pagenum)

    if pagename:
        pages = [page for page in pages if page.name == pagename]
        if pages == []:
            raise IndexError('Page not found: pagename=%s' % pagename)

    return pages
11367
private function makeQuery($pageNumber = 1)
    {
        $params = array(
            'page_size' => $this->pageSize,
            'page' => $pageNumber
        );
        $params = array_merge($params, $this->filter);
        $params = array_merge($params, $this->order);
        $response = $this->api->get($this->typeClass->url(), $params);
        $this->countCached = $response->meta->total_count;

        return $response;
    }
1237652
public RulesFilter withPage(int pageNumber, int amountPerPage) {
        parameters.put("page", pageNumber);
        parameters.put("per_page", amountPerPage);
        return this;
    }
124547
def _get_pages(page_size, total_records):
        
        pages = total_records/page_size+bool(total_records%page_size)
        return range(1, pages+1)
442938
public function getPage($pageNumber)
    {
        $response = $this->makeQuery($pageNumber);
        $className = $this->typeClass->objectClass;
        $objects = array();
        if (!isset($response->data) || !$response->data)
            return array();
        foreach ($response->data as $object) {
            $objects[] = new $className($this->api, $this->typeClass, $object);
        }

        return $objects;
    }
1026389
def page(record)
      p = @pages.get(record.page_idx, record) || load(record.page_idx, record)
      unless p.uid == record.page_idx
        raise RuntimeError, "Page reference mismatch. Record " +
          "#{record.page_idx} points to page #{p.uid}"
      end

      p
    end
1109668
public int getNextPage(int prevPage) {
		reportFreePage(prevPage);
		
		if (iter.hasNextULL()) {
			//ArrayList<Long> toDelete = new ArrayList<>();
			LongLongIndex.LLEntry e = iter.nextULL();
			long pageId = e.getKey();
			long value = e.getValue();
			
			// do not return pages that are PID_DO_NOT_USE.
			while ((value > maxFreeTxId || value < 0) && iter.hasNextULL()) {
				if (value < 0 && ((-value) <= maxFreeTxId)) {
					//optimisation:, collect in list and remove later?
					toDelete.add((int)pageId);
//					idx.removeLong(pageId);
//					//idx.insertLong(pageId, -currentTxId);
//					iter.close();
//					iter = (LLIterator) idx.iterator(pageId+1, Long.MAX_VALUE);
					//idx.removeLong(pageId, value);
					//TODO or implement iter.remove() ?!
				}
				e = iter.nextULL();
				pageId = e.getKey();
				value = e.getValue();
			}
//			if (!toDelete.isEmpty()) {
//				for (Long l: toDelete) {
//					idx.removeLong(l);
//				}
//			}
			if (value >= 0 && value <= maxFreeTxId) {
				//TODO or implement iter.updateValue() ?!
				//idx.removeLong(pageId);
				idx.insertLong(pageId, -currentTxId);
				iter.close();
				iter = idx.iterator(pageId+1, Long.MAX_VALUE);
				return (int) pageId;
			}
//			if (!toDelete.isEmpty()) {
//				iter.close();
//				iter = (LLIterator) idx.iterator(pageId+1, Long.MAX_VALUE);
//			}
		}
		
		//If we didn't find any we allocate a new page.
		return lastPage.addAndGet(1);
	}
312857
List<PageEntry> getEntries(int firstIndex, int lastIndex) {
        Preconditions.checkArgument(firstIndex <= lastIndex, "firstIndex must be smaller than or equal to lastIndex.");
        ArrayList<PageEntry> result = new ArrayList<>();
        for (int i = firstIndex; i <= lastIndex; i++) {
            result.add(getEntryAt(i));
        }

        return result;
    }
209483
protected void loadPage(int pageNum) {

        int start = (pageNum - 1) * m_pageSize;
        List<CmsResultItemBean> results = m_resultBeans;
        int end = start + m_pageSize;
        if (end > results.size()) {
            end = results.size();
        }
        List<CmsResultItemBean> page = results.subList(start, end);
        boolean showPath = SortParams.path_asc.name().equals(m_searchBean.getSortOrder())
            || SortParams.path_desc.name().equals(m_searchBean.getSortOrder());
        m_resultsTab.addContentItems(page, true, showPath);
    }
250867
public static <T> Query<T> queryWithPage(ExpressionList<T> expressionList, Pageable pageable) {
        Assert.notNull(expressionList, "expressionList must not null");
        Assert.notNull(pageable, "pageable must not null");
        return expressionList.setMaxRows(pageable.getPageSize())
                .setFirstRow((int) pageable.getOffset())
                .setOrder(Converters.convertToEbeanOrderBy(pageable.getSort()));
    }