Add a page to the page cache.
173179
def cache_page(page_cache, page_hash, cache_size):
    """"""
    page_cache.append(page_hash)
    if len(page_cache) > cache_size:
        page_cache.pop(0)
1010976
public void addPage(DialogPage page) {
		pages.add(page);
		if (autoConfigureChildPages) {
			String id = getId() + "." + page.getId();
			ValkyrieRepository.getInstance().getApplicationConfig().applicationObjectConfigurer().configure(page, id);
		}
	}
408382
function (pageIndex, options, callback) {

            if (pageIndex < 0) {
                throw "pageIndex must be >= 0";
            }

            var page = this.$pageCache[pageIndex];
            if (!page) {
                page = this.$pageCache[pageIndex] = new Page(null, this, pageIndex);
            }

            var self = this;
            options = _.extend(this.$, options);
            page.fetch(options, function (err, page) {
                // insert data into items if not already inserted
                if (!err && !page.itemsInsertedIntoCollection) {
                    page.itemsInsertedIntoCollection = true;

                    // add items to collection
                    self.add(page.$items, {
                        index: (pageIndex || 0) * self.$.pageSize
                    });
                }

                if (callback) {
                    callback(err, page, options);
                }
            });
        }
773548
protected void addPage(String wizardConfigurationKey, WizardPage page) {
        pages.add(page);
        page.setWizard(this);
        if (autoConfigureChildPages) {
            String key = ((wizardConfigurationKey != null) ? wizardConfigurationKey + "." : "") + page.getId();
            ValkyrieRepository.getInstance().getApplicationConfig().applicationObjectConfigurer().configure(page, key);
        }
    }
515779
def __cache(self, file, content, document):
        

        self.__files_cache.add_content(**{file: CacheData(content=content, document=document)})
1344415
def _save_cache(self, filename, section_number_of_pages, page_references):
        """"""
        cache_path = Path(filename).with_suffix(self.CACHE_EXTENSION)
        with cache_path.open('wb') as file:
            cache = (section_number_of_pages, page_references)
            pickle.dump(cache, file)
953549
def add_page(self, orientation=''):
        ""
        if(self.state==0):
            self.open()
        family=self.font_family
        if self.underline:
            style = self.font_style + 'U'
        else:
            style = self.font_style
        size=self.font_size_pt
        lw=self.line_width
        dc=self.draw_color
        fc=self.fill_color
        tc=self.text_color
        cf=self.color_flag
        if(self.page>0):
            #Page footer
            self.in_footer=1
            self.footer()
            self.in_footer=0
            #close page
            self._endpage()
        #Start new page
        self._beginpage(orientation)
        #Set line cap style to square
        self._out('2 J')
        #Set line width
        self.line_width=lw
        self._out(sprintf('%.2f w',lw*self.k))
        #Set font
        if(family):
            self.set_font(family,style,size)
        #Set colors
        self.draw_color=dc
        if(dc!='0 G'):
            self._out(dc)
        self.fill_color=fc
        if(fc!='0 g'):
            self._out(fc)
        self.text_color=tc
        self.color_flag=cf
        #Page header
        self.header()
        #Restore line width
        if(self.line_width!=lw):
            self.line_width=lw
            self._out(sprintf('%.2f w',lw*self.k))
        #Restore font
        if(family):
            self.set_font(family,style,size)
        #Restore colors
        if(self.draw_color!=dc):
            self.draw_color=dc
            self._out(dc)
        if(self.fill_color!=fc):
            self.fill_color=fc
            self._out(fc)
        self.text_color=tc
        self.color_flag=cf
761795
def add_pages(self, path='pages'):
		
		pages_path = os.path.join(self.root_path, path)
		pages = []
		for file in _listfiles(pages_path):
			page_dir = os.path.relpath(os.path.dirname(file), pages_path)
			if page_dir == '.':
				page_dir = None
			pages.append(self.cm.Page.from_file(file, directory=page_dir))
		self.cm.add_pages(pages)
12411
public function addPage(BasePage $page)
    {
        $page->setTemplate($this);
        $this->pages[] = $page;

        return $this;
    }
1258299
public boolean addPage(PdfIndirectReference page) {
        if (!status) {
            addFirst(page);
            status = true;
            return true;
        }
        return false;
    }
1166887
protected function addTargetPage()
    {
        $targetPageId = $this->getFieldFromFlexform('search.targetPage');
        if (!empty($targetPageId)) {
            $page = BackendUtility::getRecord('pages', $targetPageId, 'title');
            $this->settings['Target Page'] = '[' . (int)$targetPageId . '] ' . $page['title'];
        }
    }
688842
private function AddAllPages()
    {
        $page = $this->pageTree->TopMost();
        while ($page)
        {
            $this->AddPageBranch($page);
            $page = $this->pageTree->NextOf($page);
        }
    }
815665
function add(src) {
      var defer = $q.defer();

      _checkImgCacheReady()
        .then(function() {
          ImgCache.cacheFile(src, function() {
            ImgCache.isCached(src, function(path, success) {
              defer.resolve(path);
            }, defer.reject);
          }, defer.reject);
        })
        .catch(defer.reject);

      return defer.promise;
    }
968412
def activate_page(self, page_id):
        

        """
        if page_id == "next":
            page_keys = list(self._pages.keys())
            key_count = len(page_keys)
            if key_count > 0:
                idx = page_keys.index(self._active_page.page_id)
                if idx >= key_count-1:
                    idx = 0
                else:
                    idx += 1
                self._active_page = self._pages[page_keys[idx]]
                self._active_page._render()
                self._page_changed(self._active_page)

        elif page_id in self._pages:
            self._active_page = self._pages[page_id]
            self._page_changed(self._active_page)
        else:
            raise ValueError("Page with {page_id} not found in page list".format(page_id = page_id))
978899
public void setPage(String key, PageSource ps) {
	ps.setLastAccessTime();

	pageSources.put(key.toLowerCase(), ps);
    }
1280614
def add_page_if_missing(request):
    

    try:
        page = Page.objects.for_request(request, best_match=True)
        return {
            'leonardo_page': page,
            # DEPRECATED
            'feincms_page': page,
        }
    except Page.DoesNotExist:
        return {}
1136487
def prepare_page(self, *args, **kwargs):
        '''
        
        '''
        super(BaseBackend, self).prepare_page(*args, **kwargs)