Creates a new page with the given number.

@param integer $number

@return Page
968563
private function getPage($number)
    {
        return new self($this->adapter, $this->strategy, $this->perPage, $number);
    }
600979
public function setMajor($number)
    {
        if (!Validator::isNumber($number)) {
            throw new InvalidNumberException($number);
        }

        $this->major = intval($number);

        return $this;
    }
1352609
public function question_number($number) {
        if (is_numeric($number)) {
            $number = html_writer::span(get_string('question'), 'accesshide') . ' ' . $number;
        }
        return html_writer::tag('span', $number, array('class' => 'slotnumber'));
    }
702838
public function setTotalNumberOfPage($number = null)
    {
        if (is_null($number)) {
            $numRecords = $this->model->select($this->count().' AS '.$this->numCount)->findOne();
            $this->totalNumOfPage = $numRecords[0]->{$this->numCount};

            return $this;
        }

        $this->totalNumOfPage = $number;

        return $this;
    }
395096
public function setPerPage($number = null)
    {
        if (is_null($number)) {
            if (property_exists($this->model, 'perPage')) {
                $this->perPage = $this->model->perPage;

                return $this;
            }
        }

        $this->perPage = $number;

        return $this;
    }
698482
public function add($number = null)
    {
        if ($number == null) {
            $this->internalSetOperationModeWithHistory('add');
        } elseif ($number instanceof Closure) {
            $this->internalSetOperationModeWithHistory('add');
            return $this->group($number);
        } else {
            $this->performOperationOnExpressionEngine('add', $number);
        }
        return $this;
    }
1193757
public function getNewRandomArticle($number = 1)
    {
        $wiki_api = $this->base_api . 'action=query&list=random&rnnamespace=0&rnlimit=' . $number;
        $json_wapi = json_decode(file_get_contents($wiki_api), true);
        $this->article_ids = [];
        foreach ($json_wapi['query']['random'] as $item) {
            $this->article_ids[] = $item['id'];
        }

        return $this->article_ids;
    }
1068493
public function truncate(DecimalNumber $number, $precision)
    {
        $precision = $this->sanitizePrecision($precision);

        if ($number->getPrecision() <= $precision) {
            return $number;
        }

        if (0 === $precision) {
            return new DecimalNumber($number->getSign() . $number->getIntegerPart());
        }

        return new DecimalNumber(
            $number->getSign()
            . $number->getIntegerPart()
            . '.'
            . substr($number->getFractionalPart(), 0, $precision)
        );
    }
956581
public function setNumPerPage($count)
    {
        if (!is_numeric($count)) {
            throw new InvalidArgumentException(
                'Number Per Page must be numeric.'
            );
        }

        $count = (int)$count;
        if ($count < 0) {
            throw new InvalidArgumentException(
                'Number Per Page must be greater than zero.'
            );
        }

        $this->numPerPage = $count;
        return $this;
    }
309819
public function row(int $number = 0)
    {
        if (!isset($this->rows[$number])) {
            return null;
        }

        return $this->cleanClone()->addPristineRecordRef(
            $this->rows[$number],
            $this->rowGetState($number)
        );
    }
33274
def new_page(self, page_number, new_chapter, **kwargs):
        """"""
        right_template = self.document.get_page_template(self, 'right')
        left_template = self.document.get_page_template(self, 'left')
        page_template = right_template if page_number % 2 else left_template
        return page_template.page(self, page_number, self.chain, new_chapter,
                                  **kwargs)
4967
public function newAction(Request $request)
    {
        $page = new Page();
        $form = $this->createForm('CoreBundle\Form\PageType', $page, array('translator'=>$this->get('translator')));
        $form->handleRequest($request);

        if ($form->isSubmitted() && $form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $em->persist($page);
            $em->flush($page);

            //if come from popup
            if ($request->isXMLHttpRequest()) {         
                return new JsonResponse(array(
                            'id' => $page->getId(), 
                        ));
            }
            $this->get('session')->getFlashBag()->add('success', 'page.created');
            
            return $this->redirectToRoute('core_page_index');
        }

        return array(
            'page' => $page,
            'form' => $form->createView(),
        );
    }
430219
public function base10($number)
    {
        if (!is_int($number)) {
            throw new \InvalidArgumentException('Expecting integer');
        }

        if ($this->integerPart === '0' && !$this->fractionalPart) {
            return $this;
        }

        $sign = '';
        $integerPart = $this->integerPart;

        if ($integerPart[0] === '-') {
            $sign = '-';
            $integerPart = substr($integerPart, 1);
        }

        if ($number >= 0) {
            $integerPart = ltrim($integerPart, '0');
            $lengthIntegerPart = strlen($integerPart);
            $integers = $lengthIntegerPart - min($number, $lengthIntegerPart);
            $zeroPad = $number - min($number, $lengthIntegerPart);

            return new self(
                $sign.substr($integerPart, 0, $integers),
                rtrim(str_pad('', $zeroPad, '0').substr($integerPart, $integers).$this->fractionalPart, '0')
            );
        }

        $number = abs($number);
        $lengthFractionalPart = strlen($this->fractionalPart);
        $fractions = $lengthFractionalPart - min($number, $lengthFractionalPart);
        $zeroPad = $number - min($number, $lengthFractionalPart);

        return new self(
            $sign.ltrim($integerPart.substr($this->fractionalPart, 0, $lengthFractionalPart - $fractions).str_pad('', $zeroPad, '0'), '0'),
            substr($this->fractionalPart, $lengthFractionalPart - $fractions)
        );
    }
315020
public function lastsImmutable(int $number = null): self
    {
        if ($this->isEmpty()) {
            return static::create(
                [],
                $this->iteratorClass,
                false
            );
        }

        if ($number === null) {
            $poppedValue = $this->last();

            if ($poppedValue === null) {
                $poppedValue = [$poppedValue];
            } else {
                $poppedValue = (array) $poppedValue;
            }

            $arrayy = static::create(
                $poppedValue,
                $this->iteratorClass,
                false
            );
        } else {
            $number = (int) $number;
            $arrayy = $this->rest(-$number);
        }

        return $arrayy;
    }
143263
public function UpdateDncNumber($Number, Request\UpdateDncNumber $UpdateDncNumber)
    {
        $uri = $this->getUri('/contact/dnc/%s', array($Number));

        return $this->put($uri, $UpdateDncNumber);
    }
1081450
public function randomImmutable(int $number = null): self
    {
        $this->generatorToArray();

        if (\count($this->array, \COUNT_NORMAL) === 0) {
            return static::create(
                [],
                $this->iteratorClass,
                false
            );
        }

        if ($number === null) {
            /** @noinspection NonSecureArrayRandUsageInspection */
            $arrayRandValue = [$this->array[\array_rand($this->array)]];

            return static::create(
                $arrayRandValue,
                $this->iteratorClass,
                false
            );
        }

        $arrayTmp = $this->array;
        /** @noinspection NonSecureShuffleUsageInspection */
        \shuffle($arrayTmp);

        return static::create(
            $arrayTmp,
            $this->iteratorClass,
            false
        )->firstsImmutable($number);
    }
299463
def page(self, number):
        

        number = self.validate_number(number)
        bottom = (number - 1) * self.per_page
        top = bottom + self.per_page

        if top + self.orphans >= self.count:
            top = self.count
        return self._get_page(self.object_list[bottom:top], number, self)