Answers whether TokenNetworkRegistry of the contracts_vesion needs deposit limits
513570
def contracts_version_expects_deposit_limits(contracts_version: Optional[str]) -> bool:
    
    if contracts_version is None:
        return True
    if contracts_version == '0.3._':
        return False
    return compare(contracts_version, '0.9.0') > -1
855015
def update_limit(self, days, kind=2, condition='>='):
        
        url = 'http://www.shanbay.com/team/setqualification/%s' % self.team_id
        data = {
            'kind': kind,
            'condition': condition,
            'value': days,
            'team': self.team_id,
            'csrfmiddlewaretoken': self._request.cookies.get('csrftoken')
        }
        r = self.request(url, 'post', data=data)
        return r.url == 'http://www.shanbay.com/referral/invite/?kind=team'
451711
function checkStability() {
		db.query(
			"SELECT is_stable, asset, SUM(amount) AS `amount` \n\
			FROM outputs JOIN units USING(unit) WHERE address=? AND sequence='good' AND is_spent=0 GROUP BY asset ORDER BY asset DESC LIMIT 1", 
			[addrInfo.address],
			function(rows){
				if (rows.length === 0) {
					cb("This textcoin either was already claimed or never existed in the network");
				} else {
					var row = rows[0];
					if (false && !row.is_stable) {
						cb("This payment is not confirmed yet, try again later");
					} else {
						if (row.asset) { // claiming asset
							opts.asset = row.asset;
							opts.amount = row.amount;
							opts.fee_paying_addresses = [addrInfo.address];
							storage.readAsset(db, row.asset, null, function(err, objAsset){
								if (err && err.indexOf("not found" !== -1)) {
									if (!conf.bLight) // full wallets must have this asset
										throw Error("textcoin asset "+row.asset+" not found");
									return network.requestHistoryFor([opts.asset], [], checkStability);
								}
								asset = opts.asset;
								opts.to_address = addressTo;
								if (objAsset.fixed_denominations){ // indivisible
									opts.tolerance_plus = 0;
									opts.tolerance_minus = 0;
									indivisibleAsset.composeAndSaveIndivisibleAssetPaymentJoint(opts);
								}
								else{ // divisible
									divisibleAsset.composeAndSaveDivisibleAssetPaymentJoint(opts);
								}
							});
						} else {// claiming bytes
							opts.send_all = true;
							opts.outputs = [{address: addressTo, amount: 0}];
							opts.callbacks = composer.getSavingCallbacks(opts.callbacks);
							composer.composeJoint(opts);
						}
					}
				}
			}
		);		
	}
922520
def is_valid_requeue_limit(requeue_limit):
    
    if not isinstance(requeue_limit, (int, long)):
        return False

    if requeue_limit <= -2:
        return False

    return True
878737
function (bidRequests, bidderRequest) {
    const payload = {
      Version: VERSION,
      Bids: bidRequests.reduce((accumulator, bid) => {
        let size = getSize(bid.sizes);
        accumulator[bid.bidId] = {};
        accumulator[bid.bidId].PlacementID = bid.params.placement;
        accumulator[bid.bidId].TransactionID = bid.transactionId;
        accumulator[bid.bidId].Width = size.width;
        accumulator[bid.bidId].Height = size.height;
        return accumulator;
      }, {}),
      PageRefreshed: getPageRefreshed()
    };

    if (bidderRequest && bidderRequest.gdprConsent) {
      payload.gdprConsent = {
        consentString: bidderRequest.gdprConsent.consentString,
        consentRequired: (typeof bidderRequest.gdprConsent.gdprApplies === 'boolean') ? bidderRequest.gdprConsent.gdprApplies : true
      };
    }

    const data = JSON.stringify(payload);
    const options = {
      withCredentials: true
    };

    return {
      method: 'POST',
      url: createEndpoint(bidRequests, bidderRequest),
      data,
      options
    };
  }
764790
def register_token(
            self,
            registry_address_hex: typing.AddressHex,
            token_address_hex: typing.AddressHex,
            retry_timeout: typing.NetworkTimeout = DEFAULT_RETRY_TIMEOUT,
    ) -> TokenNetwork:
        
        registry_address = decode_hex(registry_address_hex)
        token_address = decode_hex(token_address_hex)

        registry = self._raiden.chain.token_network_registry(registry_address)
        contracts_version = self._raiden.contract_manager.contracts_version

        if contracts_version == DEVELOPMENT_CONTRACT_VERSION:
            token_network_address = registry.add_token_with_limits(
                token_address=token_address,
                channel_participant_deposit_limit=UINT256_MAX,
                token_network_deposit_limit=UINT256_MAX,
            )
        else:
            token_network_address = registry.add_token_without_limits(
                token_address=token_address,
            )

        # Register the channel manager with the raiden registry
        waiting.wait_for_payment_network(
            self._raiden,
            registry.address,
            token_address,
            retry_timeout,
        )

        return self._raiden.chain.token_network(token_network_address)
659273
function TransactionBuilder (network, maximumFeeRate) {
  this.prevTxMap = {}
  this.network = network || networks.bitcoin

  // WARNING: This is __NOT__ to be relied on, its just another potential safety mechanism (safety in-depth)
  this.maximumFeeRate = maximumFeeRate || 2500

  this.inputs = []
  this.tx = new Transaction(this.network)
}
235689
def approve(
            self,
            allowed_address: Address,
            allowance: TokenAmount,
    ):
        
        # Note that given_block_identifier is not used here as there
        # are no preconditions to check before sending the transaction

        log_details = {
            'node': pex(self.node_address),
            'contract': pex(self.address),
            'allowed_address': pex(allowed_address),
            'allowance': allowance,
        }

        checking_block = self.client.get_checking_block()
        error_prefix = 'Call to approve will fail'
        gas_limit = self.proxy.estimate_gas(
            checking_block,
            'approve',
            to_checksum_address(allowed_address),
            allowance,
        )

        if gas_limit:
            error_prefix = 'Call to approve failed'
            log.debug('approve called', **log_details)
            transaction_hash = self.proxy.transact(
                'approve',
                safe_gas_limit(gas_limit),
                to_checksum_address(allowed_address),
                allowance,
            )

            self.client.poll(transaction_hash)
            receipt_or_none = check_transaction_threw(self.client, transaction_hash)

        transaction_executed = gas_limit is not None
        if not transaction_executed or receipt_or_none:
            if transaction_executed:
                block = receipt_or_none['blockNumber']
            else:
                block = checking_block

            self.proxy.jsonrpc_client.check_for_insufficient_eth(
                transaction_name='approve',
                transaction_executed=transaction_executed,
                required_gas=GAS_REQUIRED_FOR_APPROVE,
                block_identifier=block,
            )

            msg = self._check_why_approved_failed(allowance, block)
            error_msg = f'{error_prefix}. {msg}'
            log.critical(error_msg, **log_details)
            raise RaidenUnrecoverableError(error_msg)

        log.info('approve successful', **log_details)
229544
def SystemCoin():
        
        amount = Fixed8.FromDecimal(sum(Blockchain.GENERATION_AMOUNT) * Blockchain.DECREMENT_INTERVAL)

        owner = ECDSA.secp256r1().Curve.Infinity

        precision = 8
        admin = Crypto.ToScriptHash(PUSHF)

        return RegisterTransaction([], [], AssetType.UtilityToken,
                                   "[{\"lang\":\"zh-CN\",\"name\":\"小蚁币\"},{\"lang\":\"en\",\"name\":\"AntCoin\"}]",
                                   amount, precision, owner, admin)
1213070
def maybe_rate_limit(client, headers, atexit=False):
    """"""
    # pylint: disable=fixme
    # pylint: disable=global-statement
    # FIXME: Yes, I know this is not great. We'll fix it later. :-)
    global LAST_CLIENT, LAST_HEADERS

    if LAST_CLIENT and LAST_HEADERS:
        # Wait based on previous client/headers
        rate_limit(LAST_CLIENT, LAST_HEADERS, atexit=atexit)

    LAST_CLIENT = copy.copy(client)
    LAST_HEADERS = copy.copy(headers)
556070
final public static function isOtpTokenRecent () : bool
	{
		$maxElapsed = 60; // 1 min
		if (isset($_SESSION['otp_token_time'])) {
			$storedTime = $_SESSION['otp_token_time'];
			return ($storedTime + $maxElapsed) >= time();
		} else {
			return FALSE;
		}
	}
93731
static private boolean isInlineLimitPlanNodePossible(AbstractPlanNode pn) {
        if (pn instanceof OrderByPlanNode ||
            pn.getPlanNodeType() == PlanNodeType.AGGREGATE) {
            return true;
        }
        return false;
    }
1141538
def reserve(ctx, amount, symbol, account):
    
    print_tx(
        ctx.bitshares.reserve(
            Amount(amount, symbol, bitshares_instance=ctx.bitshares), account=account
        )
    )
421222
async function () {
    const oThis = this;

    // Validate new branded token
    logger.step("** Validating branded token");
    await oThis._validateBrandedTokenDetails();

    // Generate reserve address
    logger.step("** Generating reserve address");
    var addressRes = await oThis._generateAddress();
    oThis.reserveAddress = addressRes.data.address;
    logger.info("* address:", oThis.reserveAddress);

    // Start the BT proposal
    var proposeRes = await oThis._propose();

    // Monitor the BT proposal response
    var statusRes = await oThis._checkProposeStatus(proposeRes.data.transaction_hash);
    var registrationStatus = statusRes.data.registration_status;
    oThis.uuid = registrationStatus['uuid'];
    oThis.erc20 = registrationStatus['erc20_address'];

    // Add branded token to config file
    logger.step("** Updating branded token config file");
    await oThis._updateBrandedTokenConfig();

    // Allocating shard for storage of token balances
    logger.step("** Allocating shard for storage of token balances");
    await oThis._allocateShard();

    process.exit(0);

  }
492977
async function () {
    const oThis = this
      , web3Provider = web3ProviderFactory.getProvider(oThis.chain, 'ws')
      , abi = coreAddresses.getAbiForContract(oThis.contractName)
      , contractObj = new web3Provider.eth.Contract(abi)
      , bufferGasLimit = 10000
    ;

    contractObj.options.address = oThis.contractAddress;
    //contractObj.setProvider(web3Provider.currentProvider);

    const transactionOptions = {
      from: oThis.senderAddress,
      gasPrice: (oThis.chain === 'value') ? VC_GAS_PRICE : UC_GAS_PRICE,
      gas: (oThis.chain === 'value') ? VC_GAS_LIMIT : UC_GAS_LIMIT
    };

    const scope = contractObj.methods
      , gasToUse = await (scope[oThis.methodName].apply(scope,
      (oThis.methodArguments || []))).estimateGas(transactionOptions);

    return responseHelper.successWithData({gas_to_use: gasToUse + bufferGasLimit});
  }
429002
def _update_limits_from_api(self):
        
        try:
            self.connect()
            resp = self.conn.get_send_quota()
        except EndpointConnectionError as ex:
            logger.warning('Skipping SES: %s', str(ex))
            return
        except ClientError as ex:
            if ex.response['Error']['Code'] in ['AccessDenied', '503']:
                logger.warning('Skipping SES: %s', ex)
                return
            raise
        self.limits['Daily sending quota']._set_api_limit(resp['Max24HourSend'])
1089591
private boolean needToReclaimConnections() {
        boolean removemcw = false;
        for (int j = 0; j < maxFreePoolHashSize; ++j) {
            synchronized (freePool[j].freeConnectionLockObject) {
                int localtotalConnectionCount = totalConnectionCount.get();
                int mcwlSize = freePool[j].mcWrapperList.size();
                for (int k = 0; k < mcwlSize; ++k) {
                    MCWrapper mcw = (MCWrapper) freePool[j].mcWrapperList.get(k);
                    if (agedTimeout != -1) {
                        if (mcw.hasAgedTimedOut(agedTimeoutMillis)) {
                            removemcw = true;
                            break;
                        }
                    }
                    if (!removemcw && unusedTimeout != -1) {
                        if (mcw.hasIdleTimedOut(unusedTimeout * 1000)
                            && (localtotalConnectionCount > minConnections)) {
                            removemcw = true;
                            break;
                        }
                    }
                }
            }
            if (removemcw) {
                break;
            }
        }
        return removemcw;
    }