lets you type a page number to go to
359224
async def numbered_page(self):
        """"""
        to_delete = []
        to_delete.append(await self.bot.send_message(self.message.channel, 'What page do you want to go to?'))
        msg = await self.bot.wait_for_message(author=self.author, channel=self.message.channel,
                                              check=lambda m: m.content.isdigit(), timeout=30.0)
        if msg is not None:
            page = int(msg.content)
            to_delete.append(msg)
            if page != 0 and page <= self.maximum_pages:
                await self.show_page(page)
            else:
                to_delete.append(await self.bot.say('Invalid page given. (%s/%s)' % (page, self.maximum_pages)))
                await asyncio.sleep(5)
        else:
            to_delete.append(await self.bot.send_message(self.message.channel, 'Took too long.'))
            await asyncio.sleep(5)

        try:
            await self.bot.delete_messages(to_delete)
        except Exception:
            pass
167891
function canPageForward () {
    var elements = getElements();
    var lastTab = elements.tabs[ elements.tabs.length - 1 ];

    if (isRtl()) {
      return ctrl.offsetLeft < elements.paging.offsetWidth - elements.canvas.offsetWidth;
    }

    return lastTab && lastTab.offsetLeft + lastTab.offsetWidth > elements.canvas.clientWidth +
        ctrl.offsetLeft;
  }
182328
function Page(page) {
  if (!page) page = {};
  for (var key in page) this[key] = page[key];
  if (!this.hasOwnProperty('idx')) this.idx = 0;
  if (!this.hasOwnProperty('total')) this.total = 1;
  if (!this.hasOwnProperty('current')) {
    this.current = this.total;
  }
}
82791
def activated_by?(string_to_page, inspect_mode=false)
      inspect_mode ? (String.size(string_to_page) > @height * @width) : (string_to_page.count("\n") > @height)
    end
880179
def get_page_number_from_request(
        request, querystring_key=PAGE_LABEL, default=1):
    
    try:
        return int(request.GET[querystring_key])
    except (KeyError, TypeError, ValueError):
        return default
1163584
def on_switch_page(self, notebook, page_pointer, page_num, user_param1=None):
        
        page = notebook.get_nth_page(page_num)

        # find state of selected tab
        for tab_info in list(self.tabs.values()):
            if tab_info['page'] is page:
                state_m = tab_info['state_m']
                sm_id = state_m.state.get_state_machine().state_machine_id
                selected_state_m = self.current_state_machine_m.selection.get_selected_state()

                # If the state of the selected tab is not in the selection, set it there
                if selected_state_m is not state_m and sm_id in self.model.state_machine_manager.state_machines:
                    self.model.selected_state_machine_id = sm_id
                    self.current_state_machine_m.selection.set(state_m)
                return
519734
public final int pageY() {
    if (getTouches() != null &&  getTouches().length() > 0) {
      return getTouches().get(0).getPageY();
    } else {
      return getClientY() + GQuery.document.getScrollTop();
    }
  }
910645
def page(self, page_number=0) -> list:
        
        # workaround flask-sqlalchemy/issues/516
        offset = page_number * self.limit
        sql = 'SELECT * FROM %s {} LIMIT :li OFFSET :o' \
            % (self.model.__tablename__)
        filter_query = self.__filter_query()
        if filter_query is None:
            sql = text(sql.format(''))
            result = self.model.db.engine.execute(
                sql, li=self.limit, o=offset)
        else:
            filter_query['binds']['li'] = self.limit
            filter_query['binds']['o'] = offset
            sql = text(sql.format(filter_query['query']))
            result = self.model.db.engine.execute(
                sql, **filter_query['binds'])
        result_keys = result.keys()
        result_models = []
        for row in result:
            model = self.model()
            key_count = 0
            for key in result_keys:
                setattr(model, key, row[key_count])
                key_count = key_count + 1
            result_models.append(model)
        return result_models
467110
def paginator(context, page, leading=8, out=3, adjacent=3, sep='...'):
    
    leading_pages, out_left_pages, out_right_pages, pages = [], [], [], []
    num_pages = page.paginator.num_pages
    is_paginated = num_pages > 1
    if is_paginated:
        if num_pages < leading:
            leading_pages = [x for x in range(1, leading) if x <= num_pages]
        elif page.number <= leading - 1:
            leading_pages = [x for x in range(1, leading + 1)]
            out_right_pages = [x + num_pages for x in range(-out + 1, 1) if x + num_pages > leading]
        elif page.number > num_pages - leading + 1:
            leading_pages = [x for x in range(num_pages - leading + 1, num_pages + 1) if x <= num_pages]
            out_left_pages = [x for x in range(1, out + 1) if num_pages - x >= leading]
        else:
            leading_pages = [x for x in range(page.number - adjacent, page.number + adjacent + 1)]
            out_right_pages = [x + num_pages for x in range(-out + 1, 1)]
            out_left_pages = [x for x in range(1, out + 1)]
    if out_left_pages:
        pages.extend(out_left_pages)
        pages.append(sep)
    pages.extend(leading_pages)
    if out_right_pages:
        pages.append(sep)
        pages.extend(out_right_pages)
    return {
        'page': page,
        'pages': pages,
        'is_paginated': is_paginated,
        'separator': sep,
        'request': context.get('request'),
        'param_name': page.param_name if hasattr(page, 'param_name') else 'page',
    }
289143
def pageFooter(self, form_contents):
        """"""
        if not form_contents:
            form_contents = ''

        self.wfile.write('''\
    <div id="verify-form">
      <form method="get" accept-charset="UTF-8" action=%s>
        Identifier:
        <input type="text" name="openid_identifier" value=%s />
        <input type="submit" value="Verify" /><br />
        <input type="checkbox" name="immediate" id="immediate" /><label for="immediate">Use immediate mode</label>
        <input type="checkbox" name="use_sreg" id="use_sreg" /><label for="use_sreg">Request registration data</label>
        <input type="checkbox" name="use_pape" id="use_pape" /><label for="use_pape">Request phishing-resistent auth policy (PAPE)</label>
        <input type="checkbox" name="use_stateless" id="use_stateless" /><label for="use_stateless">Use stateless mode</label>
      </form>
    </div>
  </body>
</html>
''' % (quoteattr(self.buildURL('verify')), quoteattr(form_contents)))
262283
function (pageNum) {
            var index = util.clamp(pageNum - 1, 0, this.numPages - 1),
                page = this.state.pages[index];
            return { top: page.y0, left: page.x0 };
        }
498935
function handle1dkeys (keys, value, step, min, max) {
	step = step || 1;

	//up and right - increase by one
	if (keys[38] || keys[39]) {
		value = inc(value, step, 1);
	}

	//down and left - decrease by one
	if (keys[40] || keys[37]) {
		value = inc(value, step, -1);
	}

	//home - min
	if (keys[36]) {
		value = min;
	}

	//end - max
	if (keys[35]) {
		value = max;
	}

	//pageup
	if (keys[33]) {
		value = inc(value, step, PAGE);
	}

	//pagedown
	if (keys[34]) {
		value = inc(value, step, -PAGE);
	}

	return value;
}
375095
def page_next(self):
        """"""
        window_start = (self.parent.value('window_start') +
                        self.parent.value('window_length'))
        self.parent.overview.update_position(window_start)
89679
def manageable_pagination(options = {})
      current_page = options[:current_page] || 1
      num_pages    = options[:num_pages] || 1
      outer_window = options[:outer_window] || 4
      page_param   = options[:param_name] || :page

      if current_page <= num_pages
        previous_page = current_page - 1
        next_page     = current_page + 1
        left_window   = ((current_page - outer_window)...current_page).to_a.select{|i| i > 0}
        right_window  = ((current_page + 1)..(current_page + outer_window)).to_a.select{|i| i <= num_pages}

        elements = []

        if 1 != current_page
          # First
          elements <<  {:value => t("manageable.pagination.first"), :href => params.merge(page_param => 1)}

          # Previous
          elements <<  {:value => t("manageable.pagination.previous"), :href => params.merge(page_param => previous_page)}
        end

        # Left Gap
        if left_window.first && left_window.first != 1
          elements <<  {:value => t("manageable.pagination.gap")}
        end

        # Left window
        left_window.each do |i|
          elements <<  {:value => i, :href => params.merge(page_param => i)}
        end

        # Current Page
        elements <<  {:value => current_page, :html => {:class => "current"}}

        # Right window
        right_window.each do |i|
          elements <<  {:value => i, :href => params.merge(page_param => i)}
        end

        # Right Gap
        if right_window.last && right_window.last != num_pages
          elements <<  {:value => t("manageable.pagination.gap")}
        end

        if num_pages != current_page
          # Next
          elements <<  {:value => t("manageable.pagination.next"), :href => params.merge(page_param => next_page)}

          # Last
          elements <<  {:value => t("manageable.pagination.last"), :href => params.merge(page_param => num_pages)}
        end

        content_tag :div, :class => "pagination" do
          elements.map do |options|
            if options[:href]
              link_to options[:value], options[:href]
            else
              content_tag(:span, options[:value], options[:html])
            end
          end.join.html_safe
        end
      end
    end
138531
def initialize_page_data(self):
        """"""
        if self.term.is_a_tty:
            self.display_initialize()
        self.character_generator = self.character_factory(self.screen.wide)
        page_data = list()
        while True:
            try:
                page_data.append(next(self.character_generator))
            except StopIteration:
                break
        if LIMIT_UCS == 0x10000:
            echo(self.term.center('press any key.').rstrip())
            flushout()
            self.term.inkey(timeout=None)
        return page_data
1284429
def paginate(idx, max, url, &b)
      return '' if max == 0
      url = url.gsub(%r{^/?(.*?)/?$}, '\1')
      b ||= lambda{}
      link = lambda {|*args|
        i, title, text = args
        "<a href=\"/#{url}/#{i}#{'?' + @query_string if @query_string}\" " +
         "#{'onclick="return false;"' if (i == idx)} " +
         "class=\"#{'disabled ' if (i == idx)}#{b.call(i)}\" " +
         "title=\"#{title||"Go to page #{i}"}\">#{text||i}</a>"
      }
      res = '<div class="nav">'
      if (idx > 0)
        res << link.call(idx - 1, "Go to previous page", "&#171; Previous")
      else
        res << "<a href=\"/#{url}/0\" onclick=\"return false;\" " +
                "class=\"disabled\" title=\"Disabled\">&#171; Previous</a>"
      end
      if idx < 10
        idx.times {|i| res << link.call(i)}
      else
        (0..2).each {|i| res << link.call(i)}
        res << '&nbsp;&#8230;&nbsp;'
        ((idx-4)...idx).each {|i| res << link.call(i)}
      end
      res << link.call(idx, 'Current Page')
      if idx > (max - 10)
        ((idx+1)...max).each {|i| res << link.call(i)}
      else
        ((idx+1)..(idx+4)).each {|i| res << link.call(i)}
        res << '&nbsp;&#8230;&nbsp;'
        ((max-3)...max).each {|i| res << link.call(i)}
      end
      if (idx < (max - 1))
        res << link.call(idx + 1, "Go to next page", "Next &#187;")
      else
        res << "<a href=\"/#{url}/#{max-1}\" onclick=\"return false;\" " +
                "class=\"disabled\" title=\"Disabled\"}\">Next &#187;</a>"
      end
      res << '</div>'
    end
40025
private void navigateTo(String pageKey, String urlToOpen, String windowHandle) {
        Context.addWindow(pageKey, windowHandle);
        Context.setMainWindow(pageKey);
        Context.getDriver().navigate().to(urlToOpen);
    }