:type monetary_account_id: int

        :rtype: int
969835
def _determine_monetary_account_id(cls, monetary_account_id=None):
        

        if monetary_account_id is None:
            return context.BunqContext.user_context().primary_monetary_account.id_

        return monetary_account_id
865824
def account_id(self, value):
        
        if value == self._defaults['ai.user.accountId'] and 'ai.user.accountId' in self._values:
            del self._values['ai.user.accountId']
        else:
            self._values['ai.user.accountId'] = value
1291542
@Override
    public Class<? extends MonetaryAmount> getDefaultAmountType() {
        if (configuredDefaultAmountType==null) {
            for (MonetaryAmountFactoryProviderSpi<?> f : Bootstrap.getServices(MonetaryAmountFactoryProviderSpi.class)) {
                if (f.getQueryInclusionPolicy() == MonetaryAmountFactoryProviderSpi.QueryInclusionPolicy.ALWAYS) {
                    configuredDefaultAmountType = f.getAmountType();
                    break;
                }
            }
        }
        if(configuredDefaultAmountType==null){
            throw new MonetaryException("No MonetaryAmountFactoryProviderSpi registered.");
        }
        return configuredDefaultAmountType;
    }
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
1325248
def account_pin(self, id):
        
        id = self.__unpack_id(id)
        url = '/api/v1/accounts/{0}/pin'.format(str(id))
        return self.__api_request('POST', url)
463
def account_block(self, id):
        
        id = self.__unpack_id(id)
        url = '/api/v1/accounts/{0}/block'.format(str(id))
        return self.__api_request('POST', url)
580180
def account(self):
        
        data = self.query(Account.key)
        return Account(self, data)
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)
                )
            )
        )
192622
def account_following(self, id, max_id=None, min_id=None, since_id=None, limit=None):
        
        id = self.__unpack_id(id)
        if max_id != None:
            max_id = self.__unpack_id(max_id)
        
        if min_id != None:
            min_id = self.__unpack_id(min_id)
        
        if since_id != None:
            since_id = self.__unpack_id(since_id)
            
        params = self.__generate_params(locals(), ['id'])
        url = '/api/v1/accounts/{0}/following'.format(str(id))
        return self.__api_request('GET', url, params)
1187351
async def create_account(self, **params):
		
		logging.debug("\n\n[+] -- Create account debugging. ")
		model = {
		"unique": ["email", "public_key"],
		"required": ("public_key",),
		"default": {"count":len(settings.AVAILABLE_COIN_ID), 
					"level":2, 
					"news_count":0, 
					"email":None},
		"optional": ("phone",)}

		message = json.loads(params.get("message", "{}"))
	
		data = {**message.get("message"), "public_key":message["public_key"]}

		# check if all required
		required = all([True if i in data.keys() else False for i in model["required"]])

		if not required:
			return {"error": 400,
					"reason":"Missed required fields"}

		# Unique constraint
		get_account = await self.collection.find_one({"public_key":data.get("public_key")})

		# Try get account with current public key
		if get_account:
			return {"error": 400,
					"reason": "Unique violation error"}

		# Reload data.
		row = {i:data[i] for i in data 
				if i in model["required"] or i in model["optional"]}
		row.update({i:model["default"][i] for i in model["default"]})
		if data.get("email"):
			row["email"] = data.get("email")
		row.update({"id":await self.autoincrement()})
		await self.collection.insert_one(row)
		account = await self.collection.find_one({"public_key":row["public_key"]})

		# Create wallets
		for coinid in coin_ids:
			database = client[coinid]
			wallet_collection = database[settings.WALLET]
			wallet = await wallet_collection.insert_one({
					"account_id": account["id"],
					"wallet": self.account.validator[coinid](account["public_key"]) 
				})
		return account
1313750
def search(self, account_name):
        
        accounts = self.list()
        for a in accounts:
            if a['name'] == account_name:
                return a['id']
832638
def get_int_id(self, str_id):
        """"""
        if not str_id in self.mapping:
            if self.curr_id == IdRemapper.INT_MAX:
                return None # No more 32 bits signed integers available
            self.mapping[str_id] = self.curr_id
            self.r_mapping[self.curr_id] = str_id
            self.curr_id += 1
        return self.mapping[str_id]
1017737
def transaction_id=(transaction_id)
      if transaction_id.nil?
        fail ArgumentError, "transaction_id cannot be nil"
      end

      if transaction_id.to_s.length < 1
        fail ArgumentError, "invalid value for 'transaction_id', the character length must be great than or equal to 1."
      end

      @transaction_id = transaction_id
    end
865749
def deserialize(cls, target_class, obj):
        

        label_monetary_account = converter.deserialize(
            object_.LabelMonetaryAccount,
            obj
        )

        return target_class.create_from_label_monetary_account(
            label_monetary_account
        )
1001145
def get_by_id(self, id_code: str) -> Currency or None:
        
        try:
            return [_ for _ in self.currencies if _.id == id_code][0]
        except IndexError:
            return None
364257
def set_currency(self, currency_id):
        
        try:
            self.currency = currency_codes[currency_id]
            self.IsoMessage.FieldData(49, self.currency)
            self.rebuild()
        except KeyError:
            self.currency = None
1059039
def get_account(self, account):
        
        selector = account.to_selector()
        resp = self.request_single('GetAccount', {'account': selector})
        return zobjects.Account.from_dict(resp)