OUT:	amount in UAH, if no return - check errors
345597
public function getBalance()
	{
		$result = $this->execute('balance');
		if(count(@$result['errors']))
			$this->_errors = $result['errors'];
		return @$result['balance'];		
	}
712791
def round_sig_error(num, uncert, pm=False):
    
    u = ufloat(num, uncert)
    if pm:
        return '{:.1uL}'.format(u)
    else:
        return '{:.1uLS}'.format(u)
451711
function checkStability() {
		db.query(
			"SELECT is_stable, asset, SUM(amount) AS `amount` \n\
			FROM outputs JOIN units USING(unit) WHERE address=? AND sequence='good' AND is_spent=0 GROUP BY asset ORDER BY asset DESC LIMIT 1", 
			[addrInfo.address],
			function(rows){
				if (rows.length === 0) {
					cb("This textcoin either was already claimed or never existed in the network");
				} else {
					var row = rows[0];
					if (false && !row.is_stable) {
						cb("This payment is not confirmed yet, try again later");
					} else {
						if (row.asset) { // claiming asset
							opts.asset = row.asset;
							opts.amount = row.amount;
							opts.fee_paying_addresses = [addrInfo.address];
							storage.readAsset(db, row.asset, null, function(err, objAsset){
								if (err && err.indexOf("not found" !== -1)) {
									if (!conf.bLight) // full wallets must have this asset
										throw Error("textcoin asset "+row.asset+" not found");
									return network.requestHistoryFor([opts.asset], [], checkStability);
								}
								asset = opts.asset;
								opts.to_address = addressTo;
								if (objAsset.fixed_denominations){ // indivisible
									opts.tolerance_plus = 0;
									opts.tolerance_minus = 0;
									indivisibleAsset.composeAndSaveIndivisibleAssetPaymentJoint(opts);
								}
								else{ // divisible
									divisibleAsset.composeAndSaveDivisibleAssetPaymentJoint(opts);
								}
							});
						} else {// claiming bytes
							opts.send_all = true;
							opts.outputs = [{address: addressTo, amount: 0}];
							opts.callbacks = composer.getSavingCallbacks(opts.callbacks);
							composer.composeJoint(opts);
						}
					}
				}
			}
		);		
	}
1052816
function validateIndivisibleIssue(input, cb){
	//	if (objAsset)
	//		profiler2.start();
		conn.query(
			"SELECT count_coins FROM asset_denominations WHERE asset=? AND denomination=?", 
			[payload.asset, denomination], 
			function(rows){
				if (rows.length === 0)
					return cb("invalid denomination: "+denomination);
				if (rows.length > 1)
					throw Error("more than one record per denomination?");
				var denomInfo = rows[0];
				if (denomInfo.count_coins === null){ // uncapped
					if (input.amount % denomination !== 0)
						return cb("issue amount must be multiple of denomination");
				}
				else{
					if (input.amount !== denomination * denomInfo.count_coins)
						return cb("wrong size of issue of denomination "+denomination);
				}
			//	if (objAsset)
			//		profiler2.stop('validateIndivisibleIssue');
				cb();
			}
		);
	}
46994
function ChecksumError(cause, actual, expected) {
    this.code = 'ChecksumError';
    if (expected === undefined) {
        expected = actual;
        actual = cause;
        cause = undefined;
    }
    assert.optionalObject(cause);
    assert.string(actual);
    assert.string(expected);

    var args = [];
    if (cause) args.push(cause);
    args = args.concat('content-md5 expected to be %s, but was %s',
        expected, actual);
    WError.apply(this, args);
}
727907
def __assert_not_empty(returned):
        '''
        
        '''
        result = "Pass"
        try:
            assert (returned), "value is empty"
        except AssertionError as err:
            result = "Fail: " + six.text_type(err)
        return result
188908
function (txResult) {
    var errorCode = {
      OUT_OF_GAS: 'out of gas',
      STACK_UNDERFLOW: 'stack underflow',
      STACK_OVERFLOW: 'stack overflow',
      INVALID_JUMP: 'invalid JUMP',
      INVALID_OPCODE: 'invalid opcode',
      REVERT: 'revert',
      STATIC_STATE_CHANGE: 'static state change'
    }
    var ret = {
      error: false,
      message: ''
    }
    if (!txResult.result.vm.exceptionError) {
      return ret
    }
    var exceptionError = txResult.result.vm.exceptionError.error || ''
    var error = `VM error: ${exceptionError}.\n`
    var msg
    if (exceptionError === errorCode.INVALID_OPCODE) {
      msg = `\t\n\tThe execution might have thrown.\n`
      ret.error = true
    } else if (exceptionError === errorCode.OUT_OF_GAS) {
      msg = `\tThe transaction ran out of gas. Please increase the Gas Limit.\n`
      ret.error = true
    } else if (exceptionError === errorCode.REVERT) {
      var returnData = txResult.result.vm.return
      // It is the hash of Error(string)
      if (returnData && (returnData.slice(0, 4).toString('hex') === '08c379a0')) {
        var abiCoder = new ethers.utils.AbiCoder()
        var reason = abiCoder.decode(['string'], returnData.slice(4))[0]
        msg = `\tThe transaction has been reverted to the initial state.\nReason provided by the contract: "${reason}".`
      } else {
        msg = `\tThe transaction has been reverted to the initial state.\nNote: The called function should be payable if you send value and the value you send should be less than your current balance.`
      }
      ret.error = true
    } else if (exceptionError === errorCode.STATIC_STATE_CHANGE) {
      msg = `\tState changes is not allowed in Static Call context\n`
      ret.error = true
    }
    ret.message = `${error}${exceptionError}${msg}\tDebug the transaction to get more information.`
    return ret
  }
367115
function checkIfCreated(ID, money) {
                    db.get(`SELECT * FROM economy WHERE userID = '${ID}'`, (err, row) => {
                        if (!row) {
                            insertFirstMoney(ID);
                        } else {
                            var moneyBefore = lodash.toNumber(row.money);
                            var moneyAfter = lodash.toNumber(money);
                            var moneyUpdate = moneyBefore + moneyAfter;
                            //console.log(moneyUpdate);
                            db.run(`UPDATE economy SET money = '${moneyUpdate}' WHERE userID = '${ID}'`);
                            db.get(`SELECT * FROM economy WHERE userID = '${ID}'`, (err, row) => {
                                resolveDB(row);
                            });
                        }
                    });
                }
986397
def check(self):
        """"""
        if not self.date:
            raise XnDataError("Missing date")
        if not self.desc:
            raise XnDataError("Missing description")
        if not self.dst:
            raise XnDataError("No destination accounts")
        if not self.src:
            raise XnDataError("No source accounts")
        if not self.amount:
            raise XnDataError("No transaction amount")
580660
def out_of_date(self):
        """"""
        try:
            latest_remote_sha = self.pr_commits(self.pull_request.refresh(True))[-1].sha
            print("Latest remote sha: {}".format(latest_remote_sha))
            try:
                print("Ratelimit remaining: {}".format(self.github.ratelimit_remaining))
            except Exception:
                print("Failed to look up ratelimit remaining")
            return self.last_sha != latest_remote_sha
        except IndexError:
            return False
1224855
function RefundTransaction($oID, $txnID, $amount = 'Full', $note = '', $curCode = 'USD') {
    if ($this->_mode == 'payflow') {
      $values['ORIGID'] = $txnID;
      $values['TENDER'] = 'C';
      $values['TRXTYPE'] = 'C';
      $values['AMT'] = number_format((float)$amount, 2);
      if ($note != '') $values['COMMENT2'] = $note;
    } elseif ($this->_mode == 'nvp') {
      $values['TRANSACTIONID'] = $txnID;
      if ($amount != 'Full' && (float)$amount > 0) {
        $values['REFUNDTYPE'] = 'Partial';
        $values['CURRENCYCODE'] = $curCode;
        $values['AMT'] = number_format((float)$amount, 2);
      } else {
        $values['REFUNDTYPE'] = 'Full';
      }
      if ($note != '') $values['NOTE'] = $note;
    }
    return $this->_request($values, 'RefundTransaction');
  }
638403
function error (out, desc) {
  logger.error(header())
  if (desc) {
    logger.error(desc)
  }
  logger.error(out)
  logger.error()
}
37489
def get_unspent_outputs(addresses)
      validate_address(addresses)
      unspent = provider.list_unspent(addresses, @config[:min_confirmation], @config[:max_confirmation])
      result = unspent.map{|item|
        output_result = get_output(item['txid'], item['vout'])
        output_result.account = item['account']
        output = OpenAssets::Transaction::SpendableOutput.new(
          OpenAssets::Transaction::OutPoint.new(item['txid'], item['vout']), output_result)
        output.confirmations = item['confirmations']
        output.spendable = item['spendable']
        output.solvable = item['solvable']
        output
      }
      result
    end
1047113
def validate(self, instance, value):
        """"""
        if not isinstance(value, uuid.UUID):
            self.error(instance, value)
        return value
1138935
def check_sum(buf, csum):
    
    csum = csum.encode('utf-8')
    _csum = ord(buf[0])
    for x in buf[1:]:
        _csum ^= ord(x)

    _csum = binascii.b2a_hex(chr(_csum).encode('utf-8')).upper()
    if _csum != csum:
        sys.stderr.write('csum not matched: ({} {})\n'.format(_csum, csum))
    return _csum == csum
827051
function checkIfCreated(ID, money) {
                    db.get(`SELECT * FROM economy WHERE userID = '${ID}'`, (err, row) => {
                        if (!row) {
                            insertFirstMoney(ID);
                        } else {
                            db.run(`UPDATE economy SET money = '${money}' WHERE userID = '${ID}'`);
                            db.get(`SELECT * FROM economy WHERE userID = '${ID}'`, (err, row) => {
                                resolveDB(row);
                            });
                        }
                    });
                }
378491
def uand(self):
        """"""
        return reduce(operator.and_, self._items, self.ftype.box(1))