Return the balance of `address`.
13368
def balance_of(self, address, block_identifier='latest'):
        
        return self.proxy.contract.functions.balanceOf(
            to_checksum_address(address),
        ).call(block_identifier=block_identifier)
1359630
def BalanceFor(self, assetId):
        
        for key, fixed8 in self.Balances.items():
            if key == assetId:
                return fixed8
        return Fixed8(0)
793550
def total_tax(self):
        """"""
        q = Tax.objects.filter(receipt=self).aggregate(total=Sum('amount'))
        return q['total'] or 0
386706
def balance(self, account: Address):
        
        return self.web3.eth.getBalance(to_checksum_address(account), 'pending')
455773
def show_address_scope(self, address_scope, **_params):
        """"""
        return self.get(self.address_scope_path % (address_scope),
                        params=_params)
627363
def account_balance_before(self):
        """"""
        # TODO: Consider moving to annotation, particularly once we can count on Django 1.11's subquery support
        transaction_date = self.transaction.date
        return self.account.balance(
            leg_query=(
                models.Q(transaction__date__lt=transaction_date)
                | (
                    models.Q(transaction__date=transaction_date)
                    & models.Q(transaction_id__lt=self.transaction_id)
                )
            )
        )
719179
def onelineaddress(self, address, **kwargs):
        '''
        '''
        fields = {
            'address': address,
        }

        return self._fetch('onelineaddress', fields, **kwargs)
137833
def account_balance_after(self):
        """"""
        # TODO: Consider moving to annotation, particularly once we can count on Django 1.11's subquery support
        transaction_date = self.transaction.date
        return self.account.balance(
            leg_query=(
                models.Q(transaction__date__lt=transaction_date)
                | (
                    models.Q(transaction__date=transaction_date)
                    & models.Q(transaction_id__lte=self.transaction_id)
                )
            )
        )
1324686
def get_amount_arrears_balance(self, billing_cycle):
        """"""
        return self.to_account.balance(
            transaction__date__lt=billing_cycle.date_range.lower,
        )
455030
def balance(self):
        """"""
        while self.recNum > self.shpNum:
            self.null()
        while self.recNum < self.shpNum:
            self.record()
1322399
def _get_balance(self, account_number):
        """"""
        # Prepare data
        data = {"ctn": self.username,
                "language": "en-US",
                "accountNumber": account_number}
        # Http request
        try:
            raw_res = yield from self._session.post(BALANCE_URL,
                                                    data=data,
                                                    headers=self._headers,
                                                    timeout=self._timeout)
        except OSError:
            raise PyFidoError("Can not get balance")
        # Get balance
        try:
            json_content = yield from raw_res.json()
            balance_str = json_content\
                            .get("getAccountInfo", {})\
                            .get("balance")
        except (OSError, ValueError):
            raise PyFidoError("Can not get balance as json")
        if balance_str is None:
            raise PyFidoError("Can not get balance")
        # Casting to float
        try:
            balance = float(balance_str)
        except ValueError:
            raise PyFidoError("Can not get balance as float")

        return balance
259477
function checkAddressBalance(url, address, options) {
  options = options || {};
  let path = '/address/.../balance'.replace('...', address);
  url = resolveURL(url, path);

  return new P(function (resolve, reject) {
    request({
      url: url,
      method: 'GET',
      headers: options.headers
    }, function (err, res, body) {
      if (err) return reject(err);
      return resolve(body);
    });
  });
}
23409
def rpc_get_account_at(self, address, block_height, **con_info):
        
        if not check_account_address(address):
            return {'error': 'Invalid address', 'http_status': 400}

        if not check_block(block_height):
            return {'error': 'Invalid start block', 'http_status': 400}

        # must be b58
        if is_c32_address(address):
            address = c32ToB58(address)
    
        db = get_db_state(self.working_dir)
        account_states = db.get_account_at(address, block_height)
        db.close()

        # return credit_value and debit_value as strings, so the unwitting JS developer doesn't get confused
        # as to why large balances get mysteriously converted to doubles.
        ret = [self.export_account_state(hist) for hist in account_states]
        return self.success_response({'history': ret})
1059788
def get_balance_in_period(self, start: Datum, end: Datum):
        
        assert isinstance(start, Datum)
        assert isinstance(end, Datum)

        total = Decimal(0)

        splits = self.get_splits_in_period(start, end)

        for split in splits:
            total += split.quantity * self.account.sign
        return total
1041586
def select_inputs(self, address: str, amount: int) -> dict:
        ''''''

        utxos = []
        utxo_sum = Decimal(0)
        for tx in sorted(self.listunspent(address=address), key=itemgetter('confirmations')):

            if tx["address"] not in (self.pa_parameters.P2TH_addr,
                                     self.pa_parameters.test_P2TH_addr):

                utxos.append(
                        MutableTxIn(txid=tx['txid'],
                                    txout=tx['vout'],
                                    sequence=Sequence.max(),
                                    script_sig=ScriptSig.empty())
                         )

                utxo_sum += Decimal(tx["amount"])
                if utxo_sum >= amount:
                    return {'utxos': utxos, 'total': utxo_sum}

        if utxo_sum < amount:
            raise InsufficientFunds("Insufficient funds.")

        raise Exception("undefined behavior :.(")
294533
def get_addresses(self, account_id, **params):
        """"""
        response = self._get('v2', 'accounts', account_id, 'addresses', params=params)
        return self._make_api_object(response, Address)
1144999
def account_is_empty(address)
      get_balance(address) == 0 && get_code(address) == Constant::BYTE_EMPTY && get_nonce(address) == 0
    end