Calcula el numero maximo que se puede imprimir
763552
def calcular_limite(self):
        
        self.exponentes = sorted(list(exponentes_plural.keys()), reverse=True)
        exp = self.exponentes[0]
        self.limite = 10 ** (exp + 6) - 1
251238
protected function prepareMinMax()
    {
        $min = 1000000;
        $max = RutHelper::COMPANY_RUT_BASE;

        if (!$this->person) {
            $min = $max;
            $max = 100000000;
        }

        return [$min, $max];
    }
1053572
private function setBasicConstants(){
        //Algunas constantes - La idea es ir sacandolas
        //PATHROOT: direccion de la carpeta del framework - definida en index.php
        define('PATHROOT', $this->getPathRoot());
        //PATHFRA: direccion de la carpeta del framework - definida en index.php
        define('PATHFRA', $this->getPathFra());    
        //PATHAPP: direccion de la carpeta de la aplicacion - definida en index.php
        define('PATHAPP', $this->getPathApp());
        //ENOLA_MODE: Indica si la aplicacion se esta ejecutando via HTTP o CLI
        if(PHP_SAPI == 'cli' || !filter_input(INPUT_SERVER, 'REQUEST_METHOD')){
            define('ENOLA_MODE', 'CLI');
        }else{
            define('ENOLA_MODE', 'HTTP');
        }
    }
774677
private function _prepareLimit()
	{
		$sQuery = '';
		$limit = (int) $this->_iLimit;
		$iOffset = $this->_iOffset;

		if($limit != 0 || $iOffset > 0) { $sQuery .= ' LIMIT '; }

		if($iOffset > 0) { $sQuery .= $iOffset.', '.$limit; }
		else if($limit != 0) { $sQuery .= $limit.' '; }

		return $sQuery;
	}
170764
public static function IMPRODUCT() {
		// Return value
		$returnValue = self::_parseComplex('1');
		$activeSuffix = '';

		// Loop through the arguments
		$aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
		foreach ($aArgs as $arg) {
			$parsedComplex = self::_parseComplex($arg);

			$workValue = $returnValue;
			if (($parsedComplex['suffix'] != '') && ($activeSuffix == '')) {
				$activeSuffix = $parsedComplex['suffix'];
			} elseif (($parsedComplex['suffix'] != '') && ($activeSuffix != $parsedComplex['suffix'])) {
				return PHPExcel_Calculation_Functions::NaN();
			}
			$returnValue['real'] = ($workValue['real'] * $parsedComplex['real']) - ($workValue['imaginary'] * $parsedComplex['imaginary']);
			$returnValue['imaginary'] = ($workValue['real'] * $parsedComplex['imaginary']) + ($workValue['imaginary'] * $parsedComplex['real']);
		}

		if ($returnValue['imaginary'] == 0.0) { $activeSuffix = ''; }
		return self::COMPLEX($returnValue['real'],$returnValue['imaginary'],$activeSuffix);
	}
123289
protected function _decimal()
    {
        $sign = 1;

        if ($this->value < 0) {
            $sign = -1;
        }

        return new N($sign * (abs($this->value) - floor(abs($this->value))));
    }
1023711
public function getMinValue()
    {
        if ($this->isUnsigned) {
            return 0;
        }

        if (!is_null($value = $this->getMaxValue())) {
            return ($value * -1) - ($this->isDecimal() ? 0 : 1);
        }

        return null;
    }
976905
protected function gerarNossoNumero()
    {
        return Util::numberFormatGeral($this->getNumero(), 11)
            . CalculoDV::bradescoNossoNumero($this->getCarteira(), $this->getNumero());
    }
841694
protected function m()
    {
        $n = 0;
        $i = 0;
        while (true) {
            if ($i > $this->j)
                return $n;
            if (! $this->cons($i))
                break;
            $i++;
        }
        $i++;
        while (true) {
            while (true) {
                if ($i > $this->j)
                    return $n;
                if ($this->cons($i))
                    break;
                $i++;
            }
            $i++;
            $n++;
            while (true) {
                if ($i > $this->j)
                    return $n;
                if (! $this->cons($i))
                    break;
                $i++;
            }
            $i++;
        }
    }
695184
public function getTotalMillis() : int
    {
        $millis = $this->seconds * 1000;
        $millis += \intdiv($this->nanos, 1000000);

        return $millis;
    }
823124
public function isOptional()
    {
        $min = (int) $this->getConfigurationValue('repeat_min');
        $max = (int) $this->getConfigurationValue('repeat_max');

        return $min === 0 && $max > 0;
    }
1241153
def verifica(ver_list, res_dict, difs):
    ""
    for k, v in ver_list.items():
        # normalizo a float para poder comparar numericamente:
        if isinstance(v, (Decimal, int, long)):
            v = float(v)
        if isinstance(res_dict.get(k), (Decimal, int, long)):
            res_dict[k] = float(res_dict[k])
        if isinstance(v, list):
            # verifico que ambas listas tengan la misma cantidad de elementos:
            if v and not k in res_dict and v:
                difs.append("falta tag %s: %s %s" % (k, repr(v), repr(res_dict.get(k))))
            elif len(res_dict.get(k, []))!=len(v or []):
                difs.append("tag %s len !=: %s %s" % (k, repr(v), repr(res_dict.get(k))))
            else:
                # ordeno las listas para poder compararlas si vienen mezcladas
                rl = sorted(res_dict.get(k, []))
                # comparo los elementos uno a uno:
                for i, vl in enumerate(sorted(v)):
                    verifica(vl, rl[i], difs)
        elif isinstance(v, dict):
            # comparo recursivamente los elementos:
            verifica(v, res_dict.get(k, {}), difs)
        elif res_dict.get(k) is None or v is None:
            # alguno de los dos es nulo, verifico si ambos lo son o faltan
            if v=="":
                v = None
            r = res_dict.get(k)
            if r=="":
                r = None
            if not (r is None and v is None):
                difs.append("%s: nil %s!=%s" % (k, repr(v), repr(r)))
        elif type(res_dict.get(k)) == type(v):
            # tipos iguales, los comparo directamente
            if res_dict.get(k) != v:
                difs.append("%s: %s!=%s" % (k, repr(v), repr(res_dict.get(k))))
        elif isinstance(v, float) or isinstance(res_dict.get(k), float):
            # comparar numericamente
            if float(res_dict.get(k)) != float(v):
                difs.append("%s: %s!=%s" % (k, repr(v), repr(res_dict.get(k))))
        elif unicode(res_dict.get(k)) != unicode(v):
            # tipos diferentes, comparo la representación  
            difs.append("%s: str %s!=%s" % (k, repr(v), repr(res_dict.get(k))))
        else:
            pass
320967
public function purityIncrease() : float
    {
        $impurity = $this->impurity;

        if ($this->left instanceof Purity) {
            $impurity -= $this->left->impurity()
                * ($this->left->n() / $this->n);
        }

        if ($this->right instanceof Purity) {
            $impurity -= $this->right->impurity()
                * ($this->right->n() / $this->n);
        }

        return $impurity;
    }
221609
protected function bound()
    {
        $number = $this->getParameter('number');
        $min = $this->getParameter('min');
        $max = $this->getParameter('max');

        if ($number instanceof Meta) {
            $number = $number->getValue();
        }

        return NumberUtils::bound($number, $min, $max);
    }
39485
def __numero_tres_cifras(self, number, indice=None, sing=False):
        """"""
        number = int(number)

        if number < 30:
            if sing:
                return especiales_apocopado[number]
            else:
                return especiales_masculino[number]

        elif number < 100:
            texto = decenas[number // 10]
            resto = number % 10
            if resto:
                texto += ' y %s' % self.__numero_tres_cifras(resto, None, sing)
            return texto

        if number == 100:
            return 'cien'

        if number < 1000:
            texto = centena_masculino[number // 100]
            resto = number % 100
            if resto:
                texto += ' %s' % self.__numero_tres_cifras(resto, None, sing)
            return texto
539595
public static function IMSUM() {
		// Return value
		$returnValue = self::_parseComplex('0');
		$activeSuffix = '';

		// Loop through the arguments
		$aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
		foreach ($aArgs as $arg) {
			$parsedComplex = self::_parseComplex($arg);

			if ($activeSuffix == '') {
				$activeSuffix = $parsedComplex['suffix'];
			} elseif (($parsedComplex['suffix'] != '') && ($activeSuffix != $parsedComplex['suffix'])) {
				return PHPExcel_Calculation_Functions::VALUE();
			}

			$returnValue['real'] += $parsedComplex['real'];
			$returnValue['imaginary'] += $parsedComplex['imaginary'];
		}

		if ($returnValue['imaginary'] == 0.0) { $activeSuffix = ''; }
		return self::COMPLEX($returnValue['real'],$returnValue['imaginary'],$activeSuffix);
	}
17855
public function getQuality()
    {
        $default = 90;

        if (!is_numeric($this->q)) {
            return $default;
        }

        if ($this->q < 0 or $this->q > 100) {
            return $default;
        }

        return (int) $this->q;
    }