/* (non-Javadoc)
@see com.popbill.api.BaseService#getBalance(java.lang.String)
161540
@Override
	public double getBalance(String CorpNum) throws PopbillException {
		try {
			return getTokenbuilder().getBalance(
					this.getSessionToken(CorpNum, null));
		} catch (LinkhubException le) {
			throw new PopbillException(le);
		}
	}
270043
func (c *Client) GetBalances(accessToken string) (resp GetBalancesResponse, err error) {
	options := GetBalancesOptions{
		AccountIDs: []string{},
	}
	return c.GetBalancesWithOptions(accessToken, options)
}
941903
@Override
	public ChargeInfo getChargeInfo(String corpNum) throws PopbillException {
		return httpget("/FAX/ChargeInfo", corpNum, null, ChargeInfo.class);
	}
1027915
private void balance() {
        // only try to balance when we're not terminating
        if(!isTerminated()) {
            Set<Map.Entry<Thread, Tracking>> threads = liveThreads.entrySet();
            long liveAvgTimeTotal = 0;
            long liveAvgCpuTotal = 0;
            long liveCount = 0;
            for (Map.Entry<Thread, Tracking> e : threads) {
                if (!e.getKey().isAlive()) {
                    // thread is dead or otherwise hosed
                    threads.remove(e);
                } else {
                    liveAvgTimeTotal += e.getValue().avgTotalTime;
                    liveAvgCpuTotal += e.getValue().avgCpuTime;
                    liveCount++;
                }
            }
            long waitTime = 1;
            long cpuTime = 1;
            if(liveCount > 0) {
                waitTime = liveAvgTimeTotal / liveCount;
                cpuTime = liveAvgCpuTotal / liveCount;
            }

            int size = 1;
            if(cpuTime > 0) {
                size = (int) ceil((CPUS * targetUtilization * (1 + (waitTime / cpuTime))));
            }
            size = Math.min(size, threadPoolExecutor.getMaximumPoolSize());

            // TODO remove debugging
            //System.out.println(waitTime / 1000000 + " ms");
            //System.out.println(cpuTime / 1000000 + " ms");
            //System.out.println(size);

            threadPoolExecutor.setCorePoolSize(size);
        }
    }
956410
public double getAverage() {
        readLock.lock();
        try {
            // any values at all, needed to avoid a DivideByZero exception
            if (this.values.size() <= 0) {
                return 0;
            }
            return ((double)this.total / (double)this.values.size());
        } finally {
            readLock.unlock();
        }
    }
668350
@Override
    public int getBondOrderSum() {
        int sum = 0;
        for (int i = 0; i < getBondCount(); i++) {
            IBond.Order order = getBond(i).getOrder();
            if (order != null) {
                sum += order.numeric();
            }
        }
        return sum;
    }
150197
func (self *StateDB) GetBalance(addr common.Address) *big.Int {
	stateObject := self.getStateObject(addr)
	if stateObject != nil {
		return stateObject.Balance()
	}
	return common.Big0
}
941795
public function getBalanceInfo($oauth_token, $sourceAccountId = [])
    {
        $corp_id = $this->settings['corp_id'];
        $apikey  = $this->settings['api_key'];
        $secret  = $this->settings['secret_key'];
        
        $this->validateArray($sourceAccountId);

        ksort($sourceAccountId);
        $arraySplit = implode(",", $sourceAccountId);
        $arraySplit = urlencode($arraySplit);

        $uriSign       = "GET:/banking/v3/corporates/$corp_id/accounts/$arraySplit";
        $isoTime       = self::generateIsoTime();
        $authSignature = self::generateSign($uriSign, $oauth_token, $secret, $isoTime, null);

        $headers                    = array();
        $headers['Accept']          = 'application/json';
        $headers['Content-Type']    = 'application/json';
        $headers['Authorization']   = "Bearer $oauth_token";
        $headers['X-BCA-Key']       = $apikey;
        $headers['X-BCA-Timestamp'] = $isoTime;
        $headers['X-BCA-Signature'] = $authSignature;

        $request_path = "banking/v3/corporates/$corp_id/accounts/$arraySplit";
        $domain       = $this->ddnDomain();
        $full_url     = $domain . $request_path;
        
        $data = array('grant_type' => 'client_credentials');

        \Unirest\Request::curlOpts(array(
            CURLOPT_SSL_VERIFYHOST => 0,
            CURLOPT_SSLVERSION => 6,
            CURLOPT_SSL_VERIFYPEER => false,
            CURLOPT_TIMEOUT => $this->settings['timeout'] !== 30 ? $this->settings['timeout'] : 30
        ));

        $body     = \Unirest\Request\Body::form($data);
        $response = \Unirest\Request::get($full_url, $headers, $body);

        return $response;
    }
929089
final private String printBalance(Integer p, N n) {
    StringBuilder text = new StringBuilder();
    if (n != null) {
      text.append(printBalance((p + 1), n.leftChild));
      String format = "%" + (3 * p) + "s";
      text.append(String.format(format, ""));
      if (n.left == n.right) {
        text.append("[" + n.left + "] (" + n.max + ") : " + n.lists.size()
            + " lists\n");
      } else {
        text.append("[" + n.left + "-" + n.right + "] (" + n.max + ") : "
            + n.lists.size() + " lists\n");
      }
      text.append(printBalance((p + 1), n.rightChild));
    }
    return text.toString();
  }
476014
def get_balance(self, address, block="latest"):
        
        response = self.make_request("eth_getBalance", [address, block])
        return int(response['result'], 16)
533374
public Map<String, BigDecimal> getKrakenBalance() throws IOException {

    KrakenBalanceResult balanceResult =
        kraken.balance(
            exchange.getExchangeSpecification().getApiKey(),
            signatureCreator,
            exchange.getNonceFactory());
    return checkResult(balanceResult);
  }
951093
@Override
	public HTTaxinvoice getTaxinvoice(String CorpNum, String NTSConfirmNum,
			String UserID) throws PopbillException {
		
		if ( NTSConfirmNum.length() != 24 )
			throw new PopbillException(-99999999, "국세청승인번호가 올바르지 않았습니다.");
		
		return httpget("/HomeTax/Taxinvoice/" +NTSConfirmNum, CorpNum, UserID, HTTaxinvoice.class);
	}
1351168
def eth_getBalance(self, address=None, block=BLOCK_TAG_LATEST):
        
        address = address or self.eth_coinbase()
        block = validate_block(block)
        return hex_to_dec(self._call("eth_getBalance", [address, block]))
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;
    }
1338582
public function getBalance($address)
    {
        $response = $this->apiClient->get('tokens/balance', [
            'token_uid' => $this->tokenUid,
            'address' => $address,
        ]);

        if (!isset($response['balance'])) throw new \ErrorException('Unexpected API response: ' . print_r($response, true));

        return $response['balance'];
    }
374724
func (nexmo *Account) GetBalance() (float64, error) {
	// Declare this locally, since we are only going to return a float64.
	type AccountBalance struct {
		Value float64 `json:"value"`
	}

	var accBalance *AccountBalance

	r, reqErr := http.NewRequest("GET", apiRoot+"/account/get-balance/"+
		nexmo.client.apiKey+"/"+nexmo.client.apiSecret, nil)

	if reqErr != nil {
		return 0.0, reqErr
	}

	r.Header.Add("Accept", "application/json")

	resp, err := nexmo.client.HTTPClient.Do(r)
	if err != nil {
		return 0.0, err
	}

	defer func() {
		if resp != nil && resp.Body != nil {
			resp.Body.Close()
		}
	}()

	body, readErr := ioutil.ReadAll(resp.Body)
	if readErr != nil {
		return 0.0, readErr
	}

	err = json.Unmarshal(body, &accBalance)
	if err != nil {
		return 0.0, err
	}

	return accBalance.Value, nil
}
1295788
public function getBalance()
    {
        $response = $this->query($this->prepareUri('profile/balance'), [], self::METHOD_GET);
        return (double) $response;
    }