@param $n

@return string
435321
protected function readBuffer($n)
    {
        $n = min($n, strlen($this->buffer) - $this->offset);
        if ($n === 0) {
            // substr('', 0, 0) => false, which screws up read loops that are
            // expecting non-blocking reads to return ''. This avoids that edge
            // case when the buffer is empty/used up.
            return '';
        }
        $block = substr($this->buffer, $this->offset, $n);
        $this->offset += $n;
        return $block;
    }
1076146
public function take($n)
    {
        return new Enumerator(
            function () use($n) {
                foreach ($this->each() as $k => $v) {
                    yield $k => $v;
                    if (-- $n < 1)
                        return;
                }
            }
        );
    }
207588
public static String stringFor(int n)
    {
        if (n == 0)
        {
            return "CU_GRAPHICS_REGISTER_FLAGS_NONE";
        }
        String result = "";
        if ((n & CU_GRAPHICS_REGISTER_FLAGS_READ_ONLY    ) != 0) result += "CU_GRAPHICS_REGISTER_FLAGS_READ_ONLY ";
        if ((n & CU_GRAPHICS_REGISTER_FLAGS_WRITE_DISCARD) != 0) result += "CU_GRAPHICS_REGISTER_FLAGS_WRITE_DISCARD ";
        if ((n & CU_GRAPHICS_REGISTER_FLAGS_SURFACE_LDST ) != 0) result += "CU_GRAPHICS_REGISTER_FLAGS_SURFACE_LDST ";
        if ((n & CU_GRAPHICS_REGISTER_FLAGS_TEXTURE_GATHER ) != 0) result += "CU_GRAPHICS_REGISTER_FLAGS_TEXTURE_GATHER ";
        return result;
    }
775846
public function left($n)
    {
        if ($n < 0 || $n > $this->size()) {
            return new MString($this->text);
        }

        $result = substr($this->text, 0, $n);

        if ($result === false) {
            return null;
        }

        return new MString($result);
    }
1085770
public function generate(int $n) : Dataset
    {
        $samples = Matrix::gaussian($n, $this->dimensions())
            ->multiply($this->stddev)
            ->add($this->center)
            ->asArray();

        return Unlabeled::quick($samples);
    }
108226
private static function ord2charset($n) {
    if ($n >= 0 && $n <= 64) {
      return 'OTHER'; # ASCII not printable
    }
    elseif ($n >= 65 && $n <= 90) {
      return 'LATIN'; # LATIN-BASIC
    }
    elseif ($n >= 91 && $n <= 96) {
      return 'OTHER'; # ASCII not printable
    }
    elseif ($n >= 97 && $n <= 122) {
      return 'LATIN'; # LATIN-BASIC
    }
    elseif ($n >= 123 && $n <= 127) {
      return 'OTHER'; # ASCII not printable
    }
    elseif ($n >= 128 && $n <= 255) {
      return 'LATIN'; # LATIN-SUPPL
    }
    elseif ($n >= 256 && $n <= 383) {
      return 'LATIN'; # LATIN-EXT-A
    }
    elseif ($n >= 384 && $n <= 591) {
      return 'LATIN'; # LATIN-EXT-B
    }
    elseif ($n >= 880 && $n <= 1023) {
      return 'GREEK';
    }
    elseif ($n >= 1024 && $n <= 1279) {
      return 'CYRILLIC';
    }
    elseif ($n >= 1328 && $n <= 1423) {
      return 'ARMENIAN';
    }
    elseif ($n >= 1424 && $n <= 1535) {
      return 'HEBREW';
    }
    elseif ($n >= 1536 && $n <= 1791) {
      return 'ARABIC';
    }
    elseif ($n >= 2304 && $n <= 2431) {
      return 'DEVANAGARI';
    }
    elseif ($n >= 2432 && $n <= 2559) {
      return 'BENGALI';
    }
    elseif ($n >= 2688 && $n <= 2815) {
      return 'GUJARATI';
    }
    elseif ($n >= 2944 && $n <= 3071) {
      return 'TAMIL';
    }
    elseif ($n >= 3328 && $n <= 3455) {
      return 'MALAYALAM';
    }
    elseif ($n >= 3456 && $n <= 3583) {
      return 'SINHALA';
    }
    elseif ($n >= 3584 && $n <= 3711) {
      return 'THAI';
    }
    elseif ($n >= 3712 && $n <= 3839) {
      return 'LAO';
    }
    elseif ($n >= 3840 && $n <= 4095) {
      return 'TIBETAN';
    }
    elseif ($n >= 4096 && $n <= 4255) {
      return 'BURMESE';
    }
    elseif ($n >= 4256 && $n <= 4351) {
      return 'GEORGIAN';
    }
    elseif ($n >= 4352 && $n <= 4607) {
      return 'KOREAN'; # HANGUL-JAMO
    }
    elseif ($n >= 6016 && $n <= 6143) {
      return 'KHMER';
    }
    elseif ($n >= 7680 && $n <= 7935) {
      return 'LATIN'; # LATIN-EXT-ADDL
    }
    elseif ($n >= 7936 && $n <= 8191) {
      return 'GREEK'; # Greek Extended
    }
    elseif ($n >= 12288 && $n <= 12351) {
      return 'OTHER'; # CJK Punctuation
    }
    elseif ($n >= 12352 && $n <= 12447) {
      return 'JAPANESE'; # Hiragana
    }
    elseif ($n >= 12448 && $n <= 12543) {
      return 'JAPANESE'; # Katakana
    }
    elseif ($n >= 13312 && $n <= 19893) {
      return 'CJK'; # CJK Unified Ideographs Extension A
    }
    elseif ($n >= 19968 && $n <= 40959) {
      return 'CJK'; # CJK Unified Ideographs
    }
    elseif ($n >= 44032 && $n <= 55203) {
      return 'KOREAN'; # Hangul Syllables
    }
    return 'OTHER';
  }
811464
public function writeLongLong($n)
    {
        $this->flushBits();
        $this->out .= implode('', Writer::chrByteSplit($n, 8));
        return $this;
    }
383970
public function last($n)
    {
        $last = '';

        if ($n > 0)
        {
            $last = UTF8::substr
            (
                $this->scalarString,
                -$n,
                null,
                $this->encoding
            );
        }

        return $this->newSelf($last);
    }
1076396
private function base62toDec($n)
    {
        $n = preg_replace("/[^A-Za-z0-9 ]/", '', $n);
        $vals = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
        $vals = array_flip(str_split($vals));
        $out = 0;
        $len = strlen($n);
        for ($i = 0; $i < $len; $i++)
        {
            $c = $n[$len - ($i + 1)];
            $out += $vals[$c] * pow(62, $i);
        }

        return (int)$out;
    }
188297
private function selectString($n)
    {
        if (is_null($this->pluralexpression)) {
            $this->pluralexpression = new ExpressionLanguage();
        }
        try {
            $plural = $this->pluralexpression->evaluate(
                $this->getPluralForms(),
                ['n' => $n]
            );
        } catch (\Exception $e) {
            $plural = 0;
        }

        if ($plural >= $this->pluralcount) {
            $plural = $this->pluralcount - 1;
        }

        return $plural;
    }
1233916
public function chop($n)
    {
        if ($n >= $this->size()) {
            $this->text = "";
            return;
        }

        $result = substr($this->text, 0, strlen($this->text) - $n);

        if ($result !== false) {
            $this->text = $result;
        }
    }
696594
public static function num2alpha($n)
    {
        $n = $n - 1;
        $r = '';
        for ($i = 1; $n >= 0 && $i < 10; $i++) {
            $r = chr(0x41 + ($n % pow(26, $i) / pow(26, $i - 1))) . $r;
            $n -= pow(26, $i);
        }
        return $r;
    }
914717
private static function error($n) {

		$messages = [
			JSON_ERROR_DEPTH 	 		=> 'Maximum stack depth exceeded',
            JSON_ERROR_CTRL_CHAR 		=> 'Unexpected control character found',
            JSON_ERROR_SYNTAX 	 		=> 'Syntax error, malformed JSON',
            static::FIREBASE_GENERAL	=> 'Firebase encountered an unknown error',
            static::INVALID_OPTION		=> 'The Token Configuration Service encountered an invalid option in the configuration'
		];

		throw new \UnexpectedValueException($messages[$n] ?: 'Unknown Error: '.$n);
	}
629362
public static String stringFor(int n)
    {
        switch (n)
        {
            case CU_LIMIT_STACK_SIZE : return "CU_LIMIT_STACK_SIZE";
            case CU_LIMIT_PRINTF_FIFO_SIZE : return "CU_LIMIT_PRINTF_FIFO_SIZE";
            case CU_LIMIT_MALLOC_HEAP_SIZE : return "CU_LIMIT_MALLOC_HEAP_SIZE";
            case CU_LIMIT_DEV_RUNTIME_SYNC_DEPTH : return "CU_LIMIT_DEV_RUNTIME_SYNC_DEPTH";
            case CU_LIMIT_DEV_RUNTIME_PENDING_LAUNCH_COUNT : return "CU_LIMIT_DEV_RUNTIME_PENDING_LAUNCH_COUNT";
            case CU_LIMIT_MAX_L2_FETCH_GRANULARITY : return "CU_LIMIT_MAX_L2_FETCH_GRANULARITY";
        }
        return "INVALID CUlimit: "+n;
    }
900835
public static String stringFor(int n)
    {
        switch (n)
        {
            case CU_AD_FORMAT_UNSIGNED_INT8 : return "CU_AD_FORMAT_UNSIGNED_INT8";
            case CU_AD_FORMAT_UNSIGNED_INT16 : return "CU_AD_FORMAT_UNSIGNED_INT16";
            case CU_AD_FORMAT_UNSIGNED_INT32 : return "CU_AD_FORMAT_UNSIGNED_INT32";
            case CU_AD_FORMAT_SIGNED_INT8 : return "CU_AD_FORMAT_SIGNED_INT8";
            case CU_AD_FORMAT_SIGNED_INT16 : return "CU_AD_FORMAT_SIGNED_INT16";
            case CU_AD_FORMAT_SIGNED_INT32 : return "CU_AD_FORMAT_SIGNED_INT32";
            case CU_AD_FORMAT_HALF : return "CU_AD_FORMAT_HALF";
            case CU_AD_FORMAT_FLOAT : return "CU_AD_FORMAT_FLOAT";
        }
        return "INVALID CUarray_format: "+n;
    }
13415
public function getSigFigs($n)
    {
        $n = ltrim($n, '0+-');
        $dp = strpos($n, '.'); // decimal position
        if ($dp === false) {
            $sigfigs = strlen(rtrim($n, '0'));
        } else {
            $sigfigs = strlen(ltrim($n, '0.')); // eliminate extra decimal character
            if ($dp !== 0) {
                $sigfigs--;
            }
        }
        return $sigfigs;
    }
1070509
public function skip(int $n) : int
    {
        if ($n <= 0) {
            return 0;
        }

        $skipped = 0;
        $skipLimit = min(self::MAX_SKIP_BUFFER_SIZE, $n);
        while ($skipped < $n) {
            $buf = $this->read(min($skipLimit, $n - $skipped));
            if ($buf === null) {
                break;
            }
            $skipped += strlen($buf);
        }
        return $skipped;
    }