Returns the list of aggregates for favourite accounts
186474
def get_favourite_account_aggregates(self) -> List[AccountAggregate]:
        
        accounts = self.get_favourite_accounts()
        aggregates = []
        for account in accounts:
            aggregate = self.get_account_aggregate(account)
            aggregates.append(aggregate)

        return aggregates
674715
function retrieveAccountGroups() {
  account.getGroups(function(err, groups) {
    groups.each(function(err, group) {
      console.log(group);
    })
  });

  //finish quickstart:
  cleanup();
}
717913
def all_accounts
      all = []
      single_proxy("LIST_ACCOUNTS", {}, nil, true).each do |account|
        all << account
        sub_accounts = single_proxy("GET_SUB_ACCOUNTS_OF_ACCOUNT",
                             {
                                account_id: account["id"],
                                recursive: true,
                             },
                             nil,
                             true)
        all = all.concat(sub_accounts)
      end
      all
    end
290989
def get_aggregations_fields(cls, params):
        
        fields = []
        for key, val in params.items():
            if isinstance(val, dict):
                fields += cls.get_aggregations_fields(val)
            if key == 'field':
                fields.append(val)
        return fields
412381
def list_subgroups_accounts(self, id, account_id):
        
        path = {}
        data = {}
        params = {}

        # REQUIRED - PATH - account_id
        """ID"""
        path["account_id"] = account_id

        # REQUIRED - PATH - id
        """ID"""
        path["id"] = id

        self.logger.debug("GET /api/v1/accounts/{account_id}/outcome_groups/{id}/subgroups with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("GET", "/api/v1/accounts/{account_id}/outcome_groups/{id}/subgroups".format(**path), data=data, params=params, all_pages=True)
873189
def list_udas(self, database=None, like=None):
        
        if not database:
            database = self.current_database
        statement = ddl.ListFunction(database, like=like, aggregate=True)
        with self._execute(statement, results=True) as cur:
            result = self._get_udfs(cur, udf.ImpalaUDA)

        return result
1059550
def get_item_balances(self, acc: Account) -> list:
        
        items = []
        entries = self.get_entries(acc)
        for item in entries.filter(source_invoice=self).order_by('id'):
            assert isinstance(item, AccountEntry)
            settlements = sum_queryset(entries.filter(settled_item=item))
            bal = item.amount + settlements if item.amount is not None else settlements
            items.append((item, bal))
        return items
289987
def aggregate(cls, pipeline=None, **kwargs):
        
        return list(cls.collection.aggregate(pipeline or [], **kwargs))
1054632
def get_all(cls, account_id=None, location=None):
        
        qry = db.Enforcements.filter()

        if account_id:
            qry = qry.filter(account_id == Enforcements.account_id)

        if location:
            qry = qry.join(Resource, Resource.location == location)

        return qry
715791
def users_favorites(*args)
      options = args.extract_options!.merge(:client_id => api_key)
      args[1].nil? ? (response = conn.get("/users/#{args[0]}/favorites.json") { |req| req.params = options }) : (response = conn.get("/users/#{args[0]}/favorites/#{args[1]}.json") { |req| req.params = options })
      args.nil? ? response.body.send(sym) : response.body
    end
892833
def listaccounts(ctx):
    
    t = [["Name", "Key", "Owner", "Active", "Memo"]]
    for key in tqdm(ctx.bitshares.wallet.getPublicKeys(True)):
        for account in ctx.bitshares.wallet.getAccountsFromPublicKey(key):
            account = Account(account)
            is_owner = key in [x[0] for x in account["owner"]["key_auths"]]
            is_active = key in [x[0] for x in account["active"]["key_auths"]]
            is_memo = key == account["options"]["memo_key"]
            t.append([
                account["name"],
                key,
                "x" if is_owner else "",
                "x" if is_active else "",
                "x" if is_memo else "",
            ])
    print_table(t)
747708
def accounts(self):
        
        response = self.graph.get('%s/accounts' % self.id)

        accounts = []
        for item in response['data']:
            account = Structure(
                page = Page(
                    id = item['id'],
                    name = item['name'],
                    category = item['category']
                ),
                access_token = item['access_token'],
                permissions = item['perms']
            )

            accounts.append(account)

        return accounts
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
408534
def records(self):
        
        if self._records is None:
            self._records = RecordList(self._version, account_sid=self._solution['account_sid'], )
        return self._records
416824
def __get_all_child_accounts_as_array(self, account: Account) -> List[Account]:
        
        result = []
        # ignore placeholders ? - what if a brokerage account has cash/stocks division?
        # if not account.placeholder:
        # continue
        result.append(account)

        for child in account.children:
            sub_accounts = self.__get_all_child_accounts_as_array(child)
            result += sub_accounts

        return result
170099
def favorites
      return @favorites if @favorites
      resp = @client.request('getFavorites', ofWhat: 'Songs', userID: @id)
      @favorites = resp.map { |s| Song.new(s) }
    end
997710
def get_banks(self):
        
        if self.retrieved:
            raise errors.IllegalState('List has already been retrieved.')
        self.retrieved = True
        return objects.BankList(self._results, runtime=self._runtime)