Return a list of all accounts matching tax_type.
545421
def find_all_by_tax_type(tax_type)
        raise AccountsListNotLoadedError unless loaded?
        @accounts.inject([]) do | list, account |
          list << account if account.tax_type == tax_type
          list
        end
      end
673642
public function getTaxes()
    {
        $taxesList = [];
        /** @var Item $item */
        foreach ($this->getItems() as $item) {
            /** @var Tax $tax */
            foreach ($item->getTaxes() as $tax) {
                $taxKey = md5($tax->getName() . $tax->getType() . $tax->getRate());
                if (!isset($taxesList[$taxKey])) {
                    $newTax = new Tax([
                        'type' => $tax->getType(),
                        'name' => $tax->getName(),
                        'rate' => $tax->getRate(),
                        'rate_type' => $tax->getRateType(),
                    ]);
                    $newTax->setBaseAmount(0);
                    $newTax->setFixedAmount(0);
                    $taxesList[$taxKey] = $newTax;
                }
                $baseAmount = $item->getAmount() - $item->getDiscount();
                $taxesList[$taxKey]->addBaseAmount($baseAmount);
                $taxesList[$taxKey]->addFixedAmount(round($baseAmount * $taxesList[$taxKey]->getRate() / 100, 2));
            }
        }

        $taxes = new Bag();
        foreach ($taxesList as $tax) {
            $taxes->add($tax);
        }

        return $taxes;
    }
1021002
def list(self, request):
        """"""
        query = get_query_params(request).get("search", "")
        results = []
        base = self.model.get_base_class()
        doctypes = indexable_registry.families[base]
        for doctype, klass in doctypes.items():
            name = klass._meta.verbose_name.title()
            if query.lower() in name.lower():
                results.append(dict(
                    name=name,
                    doctype=doctype
                ))
                results.sort(key=lambda x: x["name"])
        return Response(dict(results=results))
397542
def GotAll(self, baseline, results):
    """"""
    num_base = len(baseline)
    num_rslt = len(results)
    if num_rslt > num_base:
      raise ProcessingError("Filter generated more results than base data: "
                            "%s > %s" % (num_rslt, num_base))
    if num_rslt == num_base and num_base > 0:
      return self.Issue("Found all", results)
    return []
406908
def get_items(self):
        """"""
        ils = get_item_lookup_session(runtime=self._runtime, proxy=self._proxy)
        ils.use_federated_bank_view()
        items = []
        if self.has_items():
            for idstr in self._my_map['itemIds']:
                items.append(ils.get_item(Id(idstr)))
        return ItemList(items, runtime=self._runtime, proxy=self._proxy)
716285
def as_list(self, fs_type=None):
        """"""
        entries = self._entries
        if fs_type:
            entries = filter(lambda a: a.fs_type == fs_type, entries)
        return entries
1084761
def all(self, data={}, **kwargs):
        "
        return super(VirtualAccount, self).all(data, **kwargs)
144446
def accounts(self):
        
        if self._accounts is None:
            self._accounts = AccountList(self)
        return self._accounts
1328082
def get_list(self, ids: List[str]) -> List[Account]:
        
        query = (
            self.query
            .filter(Account.guid.in_(ids))
        )
        return query.all()
27333
def get_all_accounts(bucket, region='us-west-2', json_path='accounts.json', **filters):
    """"""
    swag_opts = {
        'swag.type': 's3',
        'swag.bucket_name': bucket,
        'swag.bucket_region': region,
        'swag.data_file': json_path,
        'swag.schema_version': 1
    }

    swag = SWAGManager(**parse_swag_config_options(swag_opts))
    accounts = swag.get_all()
    accounts = [account for account in accounts['accounts'] if is_sub_dict(filters, account)]
    return {'accounts': accounts}
1252409
def items(self):
        """"""
        if self._result_cache:
            return self._result_cache.items

        return self.all().items
442282
def get_entries(self, acc: Account, cls=AccountEntry) -> QuerySet:
        
        return cls.objects.filter(Q(account=acc) & (Q(source_invoice=self) | Q(settled_invoice=self))) if acc else cls.objects.none()
273902
def get_all_accounts(self):
        """"""
        for address_hash, rlpdata in self.secure_trie.trie.iter_branch():
            if rlpdata != trie.BLANK_NODE:
                yield rlp.decode(rlpdata, Account, db=self.db, addr=address_hash)
695728
def currencies(self):
        """"""
        return [m.currency.code for m in self.monies() if m.amount]
5545
def list(
        self,
        **kwargs
    ):
        

        request = Request(
            'GET',
            '/v3/accounts'
        )

        response = self.ctx.request(request)


        if response.content_type is None:
            return response

        if not response.content_type.startswith("application/json"):
            return response

        jbody = json.loads(response.raw_body)

        parsed_body = {}

        #
        # Parse responses as defined by the API specification
        #
        if str(response.status) == "200":
            if jbody.get('accounts') is not None:
                parsed_body['accounts'] = [
                    self.ctx.account.AccountProperties.from_dict(d, self.ctx)
                    for d in jbody.get('accounts')
                ]

        elif str(response.status) == "401":
            if jbody.get('errorCode') is not None:
                parsed_body['errorCode'] = \
                    jbody.get('errorCode')

            if jbody.get('errorMessage') is not None:
                parsed_body['errorMessage'] = \
                    jbody.get('errorMessage')

        elif str(response.status) == "405":
            if jbody.get('errorCode') is not None:
                parsed_body['errorCode'] = \
                    jbody.get('errorCode')

            if jbody.get('errorMessage') is not None:
                parsed_body['errorMessage'] = \
                    jbody.get('errorMessage')

        #
        # Unexpected response status
        #
        else:
            parsed_body = jbody

        response.body = parsed_body

        return response
978560
def all(self, data={}, **kwargs):
        "
        return super(Invoice, self).all(data, **kwargs)
985371
def get_applicable_values(self):
        """"""
        return [v for v in self._values if v.is_active and not v.is_all_results]