// page returns the Page with the given index
328797
func (p *Pager) page(index int) (Page, error) {

	if pages, ok := p.element().(Pages); ok {
		if pages != nil && len(pages) > index {
			return pages[index], nil
		}
		return nil, nil
	}

	// must be PagesGroup
	// this construction looks clumsy, but ...
	// ... it is the difference between 99.5% and 100% test coverage :-)
	groups := p.element().(PagesGroup)

	i := 0
	for _, v := range groups {
		for _, page := range v.Pages {
			if i == index {
				return page, nil
			}
			i++
		}
	}
	return nil, nil
}
605671
func (c *IPMemberList) FirstPage() (*IPMemberList, error) {
	return c.getPage(c.Meta.FirstPageUri)
}
206671
func (s *IPUserList) FirstPage() (*IPUserList, error) {
	return s.getPage(s.Meta.FirstPageUri)
}
496105
func (s *DeleteMappingService) Index(index ...string) *DeleteMappingService {
	s.index = append(s.index, index...)
	return s
}
1267761
func (s *SiteInfo) Home() (page.Page, error) {
	return s.s.home, nil
}
1206677
func (s *IndicesExistsTypeService) Index(index ...string) *IndicesExistsTypeService {
	s.index = append(s.index, index...)
	return s
}
529472
func (m *abstractPagedMutable) Set(index, value int64) {
	assert(index >= 0 && index < m.size)
	pageIndex := m.pageIndex(index)
	indexInPage := m.indexInPage(index)
	m.subMutables[pageIndex].Set(indexInPage, value)
}
93537
func (s *IndicesCloseService) Index(index string) *IndicesCloseService {
	s.index = index
	return s
}
1114044
func (r *Response) PageSlice() []Page {
	pl := []Page{}
	for _, page := range r.Query.Pages {
		pl = append(pl, page)
	}
	return pl
}
85433
func (s *IndicesStatsService) Index(indices ...string) *IndicesStatsService {
	s.index = append(s.index, indices...)
	return s
}
861987
func (s *IndicesSegmentsService) Index(indices ...string) *IndicesSegmentsService {
	s.index = append(s.index, indices...)
	return s
}
459579
func (wp WeightedPages) Pages() Pages {
	pages := make(Pages, len(wp))
	for i := range wp {
		pages[i] = wp[i].Page
	}
	return pages
}
187336
func (b *CreateIndexService) Index(index string) *CreateIndexService {
	b.index = index
	return b
}
380031
func (s *RefreshService) Index(index ...string) *RefreshService {
	s.index = append(s.index, index...)
	return s
}
286802
func (pdfg *PDFGenerator) AddPage(p page) {
	pdfg.pages = append(pdfg.pages, p)
}
972462
func (d Data) Pages() Pages {
	v, found := d["pages"]
	if !found {
		return nil
	}

	switch vv := v.(type) {
	case Pages:
		return vv
	case func() Pages:
		return vv()
	default:
		panic(fmt.Sprintf("%T is not Pages", v))
	}
}
1297048
func (s *ExistsService) Index(index string) *ExistsService {
	s.index = index
	return s
}