Check if owner has required ETH balance (i.e. bigMinAmount)

@param {string} owner - Account address
@param {BigNumber} bigMinAmount - minimum required balance in big number

@return {promise<result>}
353494
function (owner, bigMinAmount) {
    const oThis = this;

    return oThis.getEthBalanceOf(owner)
      .then(function (response) {

        if (response.isFailure()) {
          return response;
        }

        var balance = response.data.balance;
        if (typeof balance === "undefined" || isNaN(Number(balance))) {
          return responseHelper.error({
            internal_error_identifier: 't_s_fm_6',
            api_error_identifier: 'something_went_wrong',
            error_config: basicHelper.fetchErrorConfig()
          });
        }

        var bigNumBalance = new BigNumber(balance);
        if (bigNumBalance.lessThan(bigMinAmount)) {
          return responseHelper.error({
            internal_error_identifier: 't_s_fm_7',
            api_error_identifier: 'insufficient_funds',
            error_config: basicHelper.fetchErrorConfig()
          });
        }

        return responseHelper.successWithData({balance: balance, bigNumBalance: bigNumBalance});
      });
  }
386706
def balance(self, account: Address):
        
        return self.web3.eth.getBalance(to_checksum_address(account), 'pending')
101938
def add_owners_for(klass, hash, &factory)
      owner = missing_owner_for(klass, hash) || return
      logger.debug { "The migrator is adding #{klass.qp} owner #{owner}..." }
      @owners << owner
      hash[owner] = yield
      add_owners_for(owner, hash, &factory)
    end
834289
async function () {
    logger.step("** Starting stake mint for st prime for beneficiary utilityChainOwner");
    const oThis = this
      , toStakeAmount = (new BigNumber(10000)).mul(new BigNumber(10).toPower(18))
    ;

    logger.info('* Utility Chain Owner transfers ST to staker');
    await fundManager.transferST(
        utilityChainOwnerAddr, utilityChainOwnerPassphrase, stakerAddr, toStakeAmount,
        {tag: 'transferSTToStaker', returnType: 'txReceipt'}
    );

    logger.info('* Staker approves openSTValue contract');
    const approveResponse = await (new approveService()).perform();
    if (approveResponse.isFailure()) {
      process.exit(1);
    }

    const approveTransactionHash = approveResponse.data.transaction_hash;

    logger.info('* Get approval status and keep doing so till success');
    const approveReceiptResponse =  await contractInteractHelper.waitAndGetTransactionReceipt(web3Provider, approveTransactionHash, {});
    if (!approveReceiptResponse.isSuccess()) {
      logger.error('Approval receipt error ', approveReceiptResponse);
      process.exit(1);
    }

    logger.info('* Start stake');

    await (new startStakeService({
      beneficiary: utilityChainOwnerAddr,
      to_stake_amount: toStakeAmount,
      uuid: coreConstants.OST_OPENSTUTILITY_ST_PRIME_UUID
    })).perform();

    await oThis._waitForSTPrimeMint();

    return Promise.resolve(responseHelper.successWithData({}));
  }
1240181
def can_transfer(self):
        
        # 1. The address needs to own the edition
        chain = BlockchainSpider.chain(self._tree, self.edition_number)

        if len(chain) == 0:
            self.reason = 'The edition number {} does not exist in the blockchain'.format(self.edition_number)
            return False

        chain = BlockchainSpider.strip_loan(chain)
        to_address = chain[-1]['to_address']
        if to_address != self.address:
            self.reason = 'Address {} does not own the edition number {}'.format(self.address, self.edition_number)
            return False

        return True
440791
function(owner_id, next) {
    var self = this,
    podName = this.getName(),
    filter = {
      owner_id : owner_id,
      type : this.getAuthType(),
      oauth_provider : this.getName()
    };
    this._dao.find('account_auth', filter, function(err, result) {
      var model, authStruct;

      if (result) {
        // normalize oauth representation
        authStruct = {
          oauth_provider : result.oauth_provider,
          repr : self._profileRepr(result)
        }
      }

      next(err, podName, filter.type, authStruct);
    });
  }
1315816
def check_rdn_deposits(raiden, user_deposit_proxy: UserDeposit):
    
    while True:
        rei_balance = user_deposit_proxy.effective_balance(raiden.address, "latest")
        rdn_balance = to_rdn(rei_balance)
        if rei_balance < MIN_REI_THRESHOLD:
            click.secho(
                (
                    f'WARNING\n'
                    f'Your account\'s RDN balance of {rdn_balance} is below the '
                    f'minimum threshold. Provided that you have either a monitoring '
                    f'service or a path finding service activated, your node is not going '
                    f'to be able to pay those services which may lead to denial of service or '
                    f'loss of funds.'
                ),
                fg='red',
            )

        gevent.sleep(CHECK_RDN_MIN_DEPOSIT_INTERVAL)
1250258
function checkAndFinalizeWallet(wallet, onDone){
	db.query("SELECT member_ready_date FROM wallets LEFT JOIN extended_pubkeys USING(wallet) WHERE wallets.wallet=?", [wallet], function(rows){
		if (rows.length === 0){ // wallet not created yet or already deleted
		//	throw Error("no wallet in checkAndFinalizeWallet");
			console.log("no wallet in checkAndFinalizeWallet");
			return onDone ? onDone() : null;
		}
		if (rows.some(function(row){ return !row.member_ready_date; }))
			return onDone ? onDone() : null;
		db.query("UPDATE wallets SET ready_date="+db.getNow()+" WHERE wallet=? AND ready_date IS NULL", [wallet], function(){
			if (onDone)
				onDone();
			eventBus.emit('wallet_completed', wallet);
		});
	});
}
552589
function checker (uid, ownerId, userRoles, requiredRoleList) {
  if (requiredRoleList.length === 0) {
    return false
  }

  if (requiredRoleList.includes(builtinRoles.Everyone)) {
    return true
  }

  if (uid && requiredRoleList.includes(builtinRoles.Authenticated)) {
    return true
  }

  for (const role of userRoles) {
    if (requiredRoleList.includes(role)) return true
  }

  // TODO: roles.Owner is actually a finer-grained restriction over usual roles. Not this.
  return requiredRoleList.includes(builtinRoles.Owner) &&
    uid &&
    (ownerId === uid)
}
270504
def validate_owner_repo_distro(ctx, param, value):
    """"""
    # pylint: disable=unused-argument
    form = "OWNER/REPO/DISTRO[/RELEASE]"
    return validate_slashes(param, value, minimum=3, maximum=4, form=form)
475283
public int getMaxYForOwner(BlockBox owner, boolean requireVisible)
    {
        int maxy = 0;
        for (int i = 0; i < size(); i++)
        {
            Box box = getBox(i);
            if ((!requireVisible || box.isDeclaredVisible()) && box.getContainingBlockBox() == owner)
            {
                int ny = box.bounds.y + box.bounds.height; //TODO: -1 here?
                if (ny > maxy) maxy = ny;
            }
        }
        return maxy;
    }
584283
protected function validateOwner()
    {
        if (0 == ($valueLength = strlen($this->owner->getValue()))) {
            return true;
        }

        $allowedLength = $this->getConfig();
        if (is_scalar($allowedLength)) {
            return $valueLength == $allowedLength;
        } else {
            return (empty($allowedLength['min']) || $valueLength >= $allowedLength['min']) &&
                   (empty($allowedLength['max']) || $valueLength <= $allowedLength['max']);
        }
    }
1297923
def owner(self):
        
        """
        if os.name == 'nt':
            if win32security is None:
                raise Exception("path.owner requires win32all to be installed")
            desc = win32security.GetFileSecurity(
                self, win32security.OWNER_SECURITY_INFORMATION)
            sid = desc.GetSecurityDescriptorOwner()
            account, domain, typecode = win32security.LookupAccountSid(None, sid)
            return domain + u'\\' + account
        else:
            if pwd is None:
                raise NotImplementedError("path.owner is not implemented on this platform.")
            st = self.stat()
            return pwd.getpwuid(st.st_uid).pw_name
264951
function (account) {
	// check if DB is initialized
	if (typeof l_accounts === 'undefined') {
		LOG.error('DB module is not loaded, please enable DB module', l_name);
		return false;
	}

	if (l_accounts.hasOwnProperty(account) === false) {
		LOG.error('[' + account + '] not found', l_name);
		return false;
	}

	return true;
}
802838
function buildPrivateElementsChain(conn, unit, message_index, output_index, payload, handlePrivateElements){
	var asset = payload.asset;
	var denomination = payload.denomination;
	var output = payload.outputs[output_index];
	var hidden_payload = _.cloneDeep(payload);
	hidden_payload.outputs.forEach(function(o){
		delete o.address;
		delete o.blinding;
		// output_hash was already added
	});
	var arrPrivateElements = [{
		unit: unit,
		message_index: message_index,
		payload: hidden_payload,
		output_index: output_index,
		output: {
			address: output.address,
			blinding: output.blinding
		}
	}];
	
	function readPayloadAndGoUp(_unit, _message_index, _output_index){
		conn.query(
			"SELECT src_unit, src_message_index, src_output_index, serial_number, denomination, amount, address, asset, \n\
				(SELECT COUNT(*) FROM unit_authors WHERE unit=?) AS count_authors \n\
			FROM inputs WHERE unit=? AND message_index=?", 
			[_unit, _unit, _message_index],
			function(in_rows){
				if (in_rows.length === 0)
					throw Error("building chain: blackbyte input not found");
				if (in_rows.length > 1)
					throw Error("building chain: more than 1 input found");
				var in_row = in_rows[0];
				if (!in_row.address)
					throw Error("readPayloadAndGoUp: input address is NULL");
				if (in_row.asset !== asset)
					throw Error("building chain: asset mismatch");
				if (in_row.denomination !== denomination)
					throw Error("building chain: denomination mismatch");
				var input = {};
				if (in_row.src_unit){ // transfer
					input.unit = in_row.src_unit;
					input.message_index = in_row.src_message_index;
					input.output_index = in_row.src_output_index;
				}
				else{
					input.type = 'issue';
					input.serial_number = in_row.serial_number;
					input.amount = in_row.amount;
					if (in_row.count_authors > 1)
						input.address = in_row.address;
				}
				conn.query(
					"SELECT address, blinding, output_hash, amount, output_index, asset, denomination FROM outputs \n\
					WHERE unit=? AND message_index=? ORDER BY output_index", 
					[_unit, _message_index], 
					function(out_rows){
						if (out_rows.length === 0)
							throw Error("blackbyte output not found");
						var output = {};
						var outputs = out_rows.map(function(o){
							if (o.asset !== asset)
								throw Error("outputs asset mismatch");
							if (o.denomination !== denomination)
								throw Error("outputs denomination mismatch");
							if (o.output_index === _output_index){
								output.address = o.address;
								output.blinding = o.blinding;
							}
							return {
								amount: o.amount,
								output_hash: o.output_hash
							};
						});
						if (!output.address)
							throw Error("output not filled");
						var objPrivateElement = {
							unit: _unit,
							message_index: _message_index,
							payload: {
								asset: asset,
								denomination: denomination,
								inputs: [input],
								outputs: outputs
							},
							output_index: _output_index,
							output: output
						};
						arrPrivateElements.push(objPrivateElement);
						(input.type === 'issue') 
							? handlePrivateElements(arrPrivateElements)
							: readPayloadAndGoUp(input.unit, input.message_index, input.output_index);
					}
				);
			}
		);
	}
	
	var input = payload.inputs[0];
	(input.type === 'issue') 
		? handlePrivateElements(arrPrivateElements)
		: readPayloadAndGoUp(input.unit, input.message_index, input.output_index);
}
416151
public function isAmountValid(TdbShopArticle $product, $requestedAmount)
    {
        if (false === is_numeric($requestedAmount)) {
            return false;
        }

        $amount = (float) $requestedAmount;

        if (floor($amount) !== $amount) {
            return false;
        }

        return true;
    }
809331
function setCachedMountContext(blockchain_id, datastore_context) {

   let userData = getUserData();
   if (!userData.datastore_contexts) {
      userData.datastore_contexts = {};
   }

   userData.datastore_contexts[blockchain_id] = datastore_context;
   setUserData(userData);
}