Bonus of body weight

@param GenderCode $genderCode
@param Tables $tables
@return int
330886
public function getBodyWeight(GenderCode $genderCode, Tables $tables): int
    {
        $weightInKg = $this->getWeightInKg($genderCode, $tables);

        return (new Weight($weightInKg, Weight::KG, $tables->getWeightTable()))->getBonus()->getValue();
    }
133044
public function getTotalNums($pkField = null, $tableName = null, $tablePrefix = null)
    {
        is_null($tableName) && $tableName = $this->getTableName();
        is_null($tablePrefix) && $tablePrefix = $this->tablePrefix;
        is_null($pkField) && $pkField = $this->db($this->getDbConf())->getPk($tableName, $tablePrefix);
        return $this->db($this->getDbConf())->table($tableName, $tablePrefix)->count($pkField, false, $this->useMaster);
    }
178584
def calculate_bw(age, weight, height, sex):
  """"""
  if sex: # female
    return 0.203 - (0.07 * age) + (0.1069 * height) + (0.2466 * weight)
  else: # male
    return 2.447 - (0.09516 * age) + (0.1074 * height) + (0.3362 * weight)
284
public function setGender(\Innova\LexiconBundle\Entity\Gender $gender = null)
    {
        $this->gender = $gender;

        return $this;
    }
1021993
static public function getGenderValue($value=null)
    {
        return $value ? ($value == 1 || $value == '男' ? 1 : ($value == 2 || $value == '女' ? 2 : 0)) : 0;
    }
1244124
public function getMalusToBaseOfWoundsWithWeaponlike(
        WeaponlikeCode $weaponlikeCode,
        Tables $tables,
        bool $fightsWithTwoWeapons
    ): int
    {
        if ($weaponlikeCode->isMelee() || $weaponlikeCode->isThrowingWeapon()) {
            return $this->getPhysicalSkills()->getMalusToBaseOfWoundsWithWeaponlike($weaponlikeCode, $tables, $fightsWithTwoWeapons);
        }
        if ($weaponlikeCode->isShootingWeapon()) {
            return $this->getCombinedSkills()->getMalusToBaseOfWoundsWithShootingWeapon(
                $weaponlikeCode->convertToRangedWeaponCodeEquivalent(),
                $tables
            );
        }
        if ($weaponlikeCode->isProjectile()) {
            return 0;
        }
        throw new Exceptions\UnknownTypeOfWeapon($weaponlikeCode);
    }
858192
private function topTenOldestQuery(string $sex, int $total): array
    {
        $prefix = DB::connection()->getTablePrefix();

        $rows = $this->birthAndDeathQuery($sex)
            ->groupBy(['i_id', 'i_file'])
            ->orderBy('days', 'desc')
            ->select(['individuals.*', DB::raw('MAX(' . $prefix . 'death.d_julianday2 - ' . $prefix . 'birth.d_julianday1) AS days')])
            ->take($total)
            ->get();

        $top10 = [];
        foreach ($rows as $row) {
            /** @var Individual $individual */
            $individual = Individual::rowMapper()($row);

            if ($individual->canShow()) {
                $top10[] = [
                    'person' => $individual,
                    'age'    => $this->calculateAge((int) $row->days),
                ];
            }
        }

        return $top10;
    }
731862
private function getHumanResultCode($code)
    {
        if (isset($this->resultCodes[$code])) {
            return $this->resultCodes[$code];
        }

        if (is_scalar($code)) {
            return $code;
        }

        return self::UNKNOWN_CODE;
    }
84357
public static function isResponseWithoutBody(int $code): bool
    {
        switch ($code) {
            case self::NO_CONTENT:
            case self::NOT_MODIFIED:
                return true;
        }
        
        return ($code >= 100 && $code < 200);
    }
678245
private int calculateSexCode(Person.Sex sex) {
		return SEX_FIELDS[baseProducer.randomInt(SEX_FIELDS.length - 1)] + (sex == Person.Sex.MALE ? 1 : 0);
	}
207111
def run(self, *args):
        """"""

        params = self.parser.parse_args(args)
        api_token = params.api_token
        genderize_all = params.genderize_all
        code = self.autogender(api_token=api_token,
                               genderize_all=genderize_all)

        return code
11266
public function getStatus()
    {
        $tables = count($this->getTables());
        $unhealth = count($this->getUnhealthyTable());

        if ($tables) {
            $healthy = $tables - $unhealth;

            return ($healthy / $tables) * 100;
        }

        return 100;
    }
901879
public function execute($exitCode = false): int
	{
		$migrations = $this->getOutstanding();

		if(($count = count($migrations)) > 0)
		{
			$message = $count === 1 ? 'There is %s outstanding migration:' : 'There are %s outstanding migrations:';

			$this->write(vsprintf($message, ['<yellow>' . $count . '</yellow>']) . PHP_EOL);

			$this->outputMigrationList($migrations);
		}
		else
		{
			$this->write('<green>There are no outstanding migrations.</green>');
		}

		return ($exitCode && $count > 0) ? static::STATUS_ERROR : static::STATUS_SUCCESS;
	}
279227
public function getHeight(Tables $tables): int
    {
        $heightInMeters = $this->getHeightInCm($tables) / 100;
        $distance = new Distance($heightInMeters, DistanceUnitCode::METER, $tables->getDistanceTable());

        return $distance->getBonus()->getValue();
    }
484320
public function countAll(string $table): int
	{
		$sql = 'SELECT * FROM '.$this->driver->quoteTable($table);
		$res = $this->driver->query($sql);
		return (int) count($res->fetchAll());
	}
356821
private void countGender(EntityIdValue gender, SiteRecord siteRecord) {
		Integer curValue = siteRecord.genderCounts.get(gender);
		if (curValue == null) {
			siteRecord.genderCounts.put(gender, 1);
		} else {
			siteRecord.genderCounts.put(gender, curValue + 1);
		}
	}
86435
public function getMissingStrengthForArmament(
        ArmamentCode $armamentCode,
        Strength $currentStrength,
        Size $bodySize
    ): int
    {
        $requiredStrength = $this->tables->getArmamentsTableByArmamentCode($armamentCode)->getRequiredStrengthOf($armamentCode);
        if ($requiredStrength === false) { // no strength is required, like for a hand
            return 0;
        }
        $missingStrength = $requiredStrength - $currentStrength->getValue();
        if ($armamentCode instanceof ArmorCode) {
            // only armor weight is related to body size
            $missingStrength += $bodySize->getValue();
        }
        if ($missingStrength < 0) {
            // missing strength can not be negative, of course
            return 0;
        }

        return $missingStrength;
    }