Return ``True`` if this page is the first root pages.
347138
def is_first_root(self):
        """"""
        parent_cache_key = 'PARENT_FOR_%d' % self.pk
        has_parent = cache.get(parent_cache_key, None)
        if has_parent is None:
            has_parent = not not self.parent
            cache.set(parent_cache_key, has_parent)

        if has_parent:
            return False
        if self._is_first_root is not None:
            return self._is_first_root
        first_root_id = cache.get('PAGE_FIRST_ROOT_ID')
        if first_root_id is not None:
            self._is_first_root = first_root_id == self.pk
            return self._is_first_root
        try:
            first_root_id = Page.objects.root().values('id')[0]['id']
        except IndexError:
            first_root_id = None
        if first_root_id is not None:
            cache.set('PAGE_FIRST_ROOT_ID', first_root_id)
        self._is_first_root = self.pk == first_root_id
        return self._is_first_root
410541
def _prior_headerfooter(self):
        """"""
        preceding_sectPr = self._sectPr.preceding_sectPr
        return (
            None if preceding_sectPr is None
            else _Footer(preceding_sectPr, self._document_part, self._hdrftr_index)
        )
354241
public static function calculateCurrentPage(int $first, int $after, int $defaultPage = 1): int
    {
        return $first && $after
            ? (int) floor(($first + $after) / $first)
            : $defaultPage;
    }
74745
public function findOneAbsoluteRoot() : ?Page
    {
        if (!$this->absoluteRoot)
        {
            $this->absoluteRoot = PageQuery::create()
                ->findRoot();
        }

        return $this->absoluteRoot;
    }
1146762
public function hasPage($index, $is_recursive = true)
    {
        if (isset($this->pages[$index])) {
            return true;
        }

        if ($is_recursive) {
            foreach ($this->pages as $page) {
                /**@var $page Page */
                if ($page->hasChild($index, $is_recursive)) {
                    return true;
                }
            }
        }

        return false;
    }
1121903
public function isSection() {
		if ($this->isCurrent()) {
			return true;
		}
		$ancestors = $this->getAncestors();
		if (Director::get_current_page() instanceof Page) {
			$node = Director::get_current_page()->asMenuItem();
			if ($node) {
				$ancestors = $node->getAncestors();
				return $ancestors && in_array($this->ID, $node->getAncestors()->column());
			}
			
		}
		return false;
	}
297903
def is_root(self):
        """"""
        sub_prefix = self.reddit_session.config.by_object[Submission]
        return self.parent_id.startswith(sub_prefix)
753968
final protected AbstractIndexPage getNextLeafPage(AbstractIndexPage indexPage) {
		int pos = getPagePosition(indexPage);
		if (pos < getNKeys()) {
			AbstractIndexPage page = getPageByPos(pos+1);
			return page.getFirstLeafPage();
		}
		if (getParent() == null) {
			return null;
		}
		//TODO we really should return the last leaf page of the previous inner page.
		//But if they get merged, then we have to shift minimal values, which is
		//complicated. For now we ignore this case, hoping that it doesn't matter much.
		return null;
	}
348230
def previous_pages_numbers(self):
        ''
        count = self._previous_pages_count() + 1
        for i in reversed(range(1, count)):
            yield i
739196
def get_parent_page(self):
        
        if self.current_level == 1:
            # 'root' page
            return None
        else:
            return self.page_data[(self.current_level - 1, self.current_count)]
1116041
def page_crawled(self, page_resp):
        
        page_text = utils.parse_text(page_resp)
        page_hash = utils.hash_text(''.join(page_text))
        if page_hash not in self.page_cache:
            utils.cache_page(self.page_cache, page_hash, self.args['cache_size'])
            return False
        return True
977293
public function isFirstCall() {
        if (!$this->stepAction && $this->stepCollection->isFirst($this->stepCollectionIterator->current()))
            return true;
        else return false;
    }
1180070
def accel_prev(self, *args):
        
        if self.get_notebook().get_current_page() == 0:
            self.get_notebook().set_current_page(self.get_notebook().get_n_pages() - 1)
        else:
            self.get_notebook().prev_page()
        return True
1140672
def valid?
      return false if @first_page.nil?
      return false if @last_page.nil?
      return false if @odd_pages.nil?
      return false if @even_pages.nil?
      return true
    end
188096
protected function calculateFirstAndLastPage()
    {
        $delta = \floor($this->maximumNumberOfLinks / 2);
        $firstPage = $this->currentPage - $delta;
        $lastPage = $this->currentPage + $delta + ($this->maximumNumberOfLinks % 2 === 0 ? 1 : 0);

        if ($firstPage < 1) {
            $lastPage -= $firstPage - 1;
        }
        if ($lastPage > $this->numberOfPages) {
            $firstPage -= ($lastPage - $this->numberOfPages);
        }

        $this->firstPage = \max($firstPage, 1);
        $this->lastPage = \min($lastPage, $this->numberOfPages);
    }
464727
def check_initial_subdomain(cls, subdomain_rec):
        
        if subdomain_rec.n != 0:
            return False
       
        if subdomain_rec.independent:
            return False

        return True
837378
def is_root(self, el):
        

        root = self.root and self.root is el
        if not root:
            parent = self.get_parent(el)
            root = parent is not None and self.is_html and self.is_iframe(parent)
        return root