gets the neutral mass for the specified mass-to-charge ratio and charge

@param float $massCharge
@param int $charge
@throws \InvalidArgumentException
@return float
519415
public static function getNeutralMass($massCharge, $charge)
    {
        if (! is_float($massCharge)) {
            throw new \InvalidArgumentException(
                'Argument 1 must be of type float. Value is of type ' . gettype($massCharge));
        }

        if (! is_int($charge)) {
            throw new \InvalidArgumentException('Argument 2 must be of type int. Value is of type ' . gettype($charge));
        }

        if ($charge == 0) {
            return $massCharge;
        }

        return ($massCharge * $charge) - (PhysicalConstants::PROTON_MASS * $charge);
    }
420882
public static function getLevelCode(
        /*# string */ $level
    )/*# : int */ {
        if (is_string($level) &&
            isset(self::$levels[$level])) {
            return self::$levels[$level];
        }

        throw new Exception\InvalidArgumentException(
            Message::get(
                Message::INVALID_LOG_LEVEL,
                (string) $level
            ),
            Message::INVALID_LOG_LEVEL
        );
    }
929754
public function capture($charge)
    {
        $result = $this->request('POST', '/charges/' . $charge . '/capture');

        return $this->objectConverter->convert($result);
    }
794409
protected function getWeight($q)
    {
        $parts = $this->split($q, '=');

        $weight = $parts[1] ?? 1.0;

        return (float) $weight;
    }
436003
public function getWeight() : ?float 
    {
        if ( ! $this->hasWeight()) {
            $this->setWeight($this->getDefaultWeight());
        }
        return $this->weight;
    }
462599
public function findPriceByCurrency($currency): ?PriceInterface
    {
        if ($currency instanceof \Money\Currency) {
            $currency = $currency->getCode();
        } elseif ($currency instanceof CurrencyInterface) {
            $currency = $currency->getIsoCodeAlpha();
        }

        if (!is_string($currency)) {
            throw new \InvalidArgumentException('$currency has to be a string');
        }

        foreach ($this->prices as $price) {
            if ($price->getCurrency()->getIsoCodeAlpha() === $currency) {
                return $price;
            }
        }

        return null;
    }
494380
public function create($recurringApplicationChargeId, UsageCharge $usageCharge)
    {
        $data = $usageCharge->exportData();
        $endpoint = '/admin/recurring_application_charges/'.$recurringApplicationChargeId.'/usage_charges.json';
        $response = $this->request(
            $endpoint, 'POST', array(
            'usage_charge' => $data
            )
        );
        $usageCharge->setData($response['usage_charge']);
    }
1324724
@Override
    public Integer getCharge() {
        Integer charge = 0;
        Iterator<IMolecularFormula> componentIterator = components.iterator();
        while (componentIterator.hasNext()) {
            charge += componentIterator.next().getCharge();
        }
        return charge;
    }
1298246
public function power($power)
    {
        if (!is_numeric($power)) {
            throw new \InvalidArgumentException('Power must be numeric');
        }

        $amount = bcpow($this->amount, strval($power), self::BCSCALE);

        return self::valueOf($amount, $this->currency);
    }
1366819
public IAtomContainer assignMMFF94PartialCharges(IAtomContainer ac) throws CDKException {
        if (!mmff.assignAtomTypes(ac))
            throw new CDKException("Molecule had an atom of unknown MMFF type");
        mmff.partialCharges(ac);
        mmff.clearProps(ac);
        for (IAtom atom : ac.atoms())
            atom.setProperty(MMFF_94_CHARGE, atom.getCharge());
        return ac;
    }
1136267
def getChargeInfo(self, CorpNum, MsgType, UserID=None):
        
        if MsgType == None or MsgType == "":
            raise PopbillException(-99999999, "전송유형이 입력되지 않았습니다.")

        return self._httpget('/Message/ChargeInfo?Type=' + MsgType, CorpNum, UserID)
1183565
public function getBalance($email, $appUid = null)
    {
        if (null === $appUid) $appUid = $this->defaultAppUid;
        if (!$appUid) throw new \InvalidArgumentException('No appUid specified');

        $response = $this->apiClient->get('app_store/balance', [
            'app_uid' => $appUid,
            'email' => $email,
        ]);

        if (!isset($response['num_credits'])) throw new \ErrorException('Unexpected API response');
        return $response['num_credits'];
    }
281484
public function getBalanceTransactionReference()
    {
        if (isset($this->data['object']) && 'charge' === $this->data['object']) {
            return $this->data['balance_transaction'];
        }
        if (isset($this->data['object']) && 'balance_transaction' === $this->data['object']) {
            return $this->data['id'];
        }
        if (isset($this->data['error']) && isset($this->data['error']['charge'])) {
            return $this->data['error']['charge'];
        }

        return null;
    }
941363
@Override
	public ChargeInfo getChargeInfo(String CorpNum, int ItemCode) throws PopbillException{
		return httpget("/Statement/ChargeInfo/" + Integer.toString(ItemCode), CorpNum, null, ChargeInfo.class);
	}
1268436
def get_electron_number(self, charge=0):
        
        atomic_number = constants.elements['atomic_number'].to_dict()
        return sum([atomic_number[atom] for atom in self['atom']]) - charge
911496
public function weigh()
    {
        $flat = $this->flatten();

        $weighed = array();
        foreach ($flat as $metric => $data) {
            $weighed[$metric] = 0;
            $relevant = 0;
            foreach ($data as $name => $value) {
                $loc = isset($flat['loc'][$name]) ? $flat['loc'][$name] : 0;
                $weighed[$metric] += $value * $loc;
                $relevant += $loc;
            }

            $weighed[$metric] = $weighed[$metric] / ($relevant ?: 1);
        }

        return $weighed;
    }
1318296
public function refund($charge, array $options = []): StripeRefund
    {
        $options['charge'] = $charge;

        return StripeRefund::create($options, ['api_key' => $this->getStripeKey()]);
    }