Get the high level balances
967162
def get_balance_context(self):
        """"""
        bank_account = Account.objects.get(name='Bank')

        return dict(
            bank=bank_account,
            retained_earnings_accounts=Account.objects.filter(parent__name='Retained Earnings'),
        )
1095620
def get_levels():
        
        levels = ffi.new('cairo_ps_level_t const **')
        num_levels = ffi.new('int *')
        cairo.cairo_ps_get_levels(levels, num_levels)
        levels = levels[0]
        return [levels[i] for i in range(num_levels[0])]
1324686
def get_amount_arrears_balance(self, billing_cycle):
        """"""
        return self.to_account.balance(
            transaction__date__lt=billing_cycle.date_range.lower,
        )
949848
def _get_balances(self):
        
        balances = []
        try:
            raw_res = yield from self._session.get(MAIN_URL,
                                                   timeout=self._timeout)
        except OSError:
            raise PyHydroQuebecError("Can not get main page")
        # Parse html
        content = yield from raw_res.text()
        soup = BeautifulSoup(content, 'html.parser')
        solde_nodes = soup.find_all("div", {"class": "solde-compte"})
        if solde_nodes == []:
            raise PyHydroQuebecError("Can not found balance")
        for solde_node in solde_nodes:
            try:
                balance = solde_node.find("p").text
            except AttributeError:
                raise PyHydroQuebecError("Can not found balance")
            balances.append(float(balance[:-2]
                            .replace(",", ".")
                            .replace("\xa0", "")))

        return balances
1108360
public function balance () {
			if (!isset($this->cache['balance'])) {
				$tmp = $this->apiCall('get_balance');
				if (!$tmp['data']) return false;

				$this->cache['balance'] = $tmp['data']['value'];
			}

			return (float)$this->cache['balance'];
		}
494246
def balance(self):
        """"""
        if len(self.records) > len(self._shapes):
            self.null()
        elif len(self.records) < len(self._shapes):
            self.record()
4323
def get_amount_arrears_transactions(self, billing_cycle):
        """"""
        previous_billing_cycle = billing_cycle.get_previous()
        if not previous_billing_cycle:
            return Decimal(0)
        return self.to_account.balance(
            transaction__date__lt=previous_billing_cycle.date_range.upper,
            transaction__date__gte=previous_billing_cycle.date_range.lower,
        )
1214538
def get_balance_on(self, on_date: datetime) -> Decimal:
        
        assert isinstance(on_date, datetime)

        total = Decimal(0)

        splits = self.get_splits_up_to(on_date)

        for split in splits:
            total += split.quantity * self.account.sign
        return total
436916
def GET_account_balance(self, path_info, account_addr, token_type):
        
        if not check_account_address(account_addr):
            return self._reply_json({'error': 'Invalid address'}, status_code=400)

        if not check_token_type(token_type):
            return self._reply_json({'error': 'Invalid token type'}, status_code=400)

        blockstackd_url = get_blockstackd_url()
        res = blockstackd_client.get_account_balance(account_addr, token_type, hostport=blockstackd_url)
        if json_is_error(res):
            log.error("Failed to get account balance for {} {}: {}".format(account_addr, token_type, res['error']))
            return self._reply_json({'error': 'Failed to get balance of {} for {}: {}'.format(token_type, account_addr, res['error'])}, status_code=res.get('http_status', 500))

        self._reply_json({'balance': str(res)})     # NOTE: use a string, since this can be too big for js clients to parse
        return
1123572
public double[] getSingularValues() {
        double ret[] = new double[W.numCols()];

        for (int i = 0; i < ret.length; i++) {
            ret[i] = getSingleValue(i);
        }
        return ret;
    }
1175537
def get(self, limit=None, offset=None):
        
        return self.connection.get('account/transfer/admin/array', limit=limit, offset=offset)
20915
def get_balance(self, account: SEPAAccount):
        

        with self._get_dialog() as dialog:
            hksal = self._find_highest_supported_command(HKSAL5, HKSAL6, HKSAL7)

            seg = hksal(
                account=hksal._fields['account'].type.from_sepa_account(account),
                all_accounts=False,
            )

            response = dialog.send(seg)

            for resp in response.response_segments(seg, 'HISAL'):
                return resp.balance_booked.as_mt940_Balance()
478078
def get_end_balance(self, after: date) -> Decimal:
        
        # create a new date without hours
        #date_corrected = datetimeutils.end_of_day(after)
        datum = Datum()
        datum.from_date(after)
        datum.end_of_day()
        #log(DEBUG, "getting balance on %s", date_corrected)
        return self.get_balance_on(datum.value)
1050169
def balance(self) -> Decimal:
        
        return sum_queryset(AccountEntry.objects.filter(account=self.account, timestamp__lte=self.timestamp).exclude(timestamp=self.timestamp, id__gt=self.id))
935139
def get_game_high_scores(self, *args, **kwargs):
        """"""
        return get_game_high_scores(*args, **self._merge_overrides(**kwargs)).run()
317487
def all_balances(currency, services=None, verbose=False, timeout=None):
    
    balances = {}
    if not services:
        services = [
            x(verbose=verbose, timeout=timeout)
            for x in ExchangeUniverse.get_authenticated_services()
        ]

    for e in services:
        try:
            balances[e] = e.get_exchange_balance(currency)
        except NotImplementedError:
            if verbose:
                print(e.name, "balance not implemented")
        except Exception as exc:
            if verbose:
                print(e.name, "failed:", exc.__class__.__name__, str(exc))

    return balances
237551
def get_items(self, maxlevel):
        """"""
        itemlist = []
        def add_to_itemlist(item, maxlevel, level=1):
            level += 1
            for index in range(item.childCount()):
                citem = item.child(index)
                itemlist.append(citem)
                if level <= maxlevel:
                    add_to_itemlist(citem, maxlevel, level)
        for tlitem in self.get_top_level_items():
            itemlist.append(tlitem)
            if maxlevel > 0:
                add_to_itemlist(tlitem, maxlevel=maxlevel)
        return itemlist