Sets the quota of this ServicePackageQuota.
        Available quota for the service package.

        :param quota: The quota of this ServicePackageQuota.
        :type: int
167865
def quota(self, quota):
        
        if quota is None:
            raise ValueError("Invalid value for `quota`, must not be `None`")
        if quota is not None and quota < 0:
            raise ValueError("Invalid value for `quota`, must be a value greater than or equal to `0`")

        self._quota = quota
1158441
private void assertMetaDataQuota(final Long moduleId, final int requested) {
        final int maxMetaData = quotaManagement.getMaxMetaDataEntriesPerSoftwareModule();
        QuotaHelper.assertAssignmentQuota(moduleId, requested, maxMetaData, SoftwareModuleMetadata.class,
                SoftwareModule.class, softwareModuleMetadataRepository::countBySoftwareModuleId);
    }
1147620
public void setPacketRetransmitLimit(int packetRetransmitLimit) {
        packetRetransmitLimit = packetRetransmitLimit < MAX_PACKET_QUEUE_LIMIT ? packetRetransmitLimit : MAX_PACKET_QUEUE_LIMIT;
        packetRetransmitLimit = packetRetransmitLimit >= 0 ? packetRetransmitLimit : 0;
        this.packetRetransmitLimit = packetRetransmitLimit;
    }
968841
def add_assignment_clause(self, clause):
        
        if not isinstance(clause, AssignmentClause):
            raise StatementException("only instances of AssignmentClause can be added to statements")
        clause.set_context_id(self.context_counter)
        self.context_counter += clause.get_context_size()
        self.assignments.append(clause)
848130
def _validate_quota(quota):
    '''
    
    '''
    if quota is not None:
        if not isinstance(quota, dict):
            raise TypeError('quota must be a dictionary, provided value: {0}'.format(quota))
        periods = ['DAY', 'WEEK', 'MONTH']
        if 'period' not in quota or quota['period'] not in periods:
            raise ValueError('quota must have a valid period specified, valid values are {0}'.format(','.join(periods)))
        if 'limit' not in quota:
            raise ValueError('quota limit must have a valid value')
883100
def get_aggregator_quotas(self, quota):
        
        ancestors = quota.scope.get_quota_ancestors()
        aggregator_quotas = []
        for ancestor in ancestors:
            for ancestor_quota_field in ancestor.get_quotas_fields(field_class=AggregatorQuotaField):
                if ancestor_quota_field.get_child_quota_name() == quota.name:
                    aggregator_quotas.append(ancestor.quotas.get(name=ancestor_quota_field))
        return aggregator_quotas
433108
def replace_one(self, filter, replacement, **kwargs):
        
        self._arctic_lib.check_quota()
        return self._collection.replace_one(filter, replacement, **kwargs)
1229665
private void assertMaxTargetsPerManualAssignmentQuota(final Long distributionSetId,
            final int requestedTargetsCount) {
        QuotaHelper.assertAssignmentQuota(distributionSetId, requestedTargetsCount,
                quotaManagement.getMaxTargetsPerManualAssignment(), Target.class, DistributionSet.class, null);
    }
897184
def change_customer_nc_users_quota(sender, structure, user, role, signal, **kwargs):
    
    assert signal in (signals.structure_role_granted, signals.structure_role_revoked), \
        'Handler "change_customer_nc_users_quota" has to be used only with structure_role signals'
    assert sender in (Customer, Project), \
        'Handler "change_customer_nc_users_quota" works only with Project and Customer models'

    if sender == Customer:
        customer = structure
    elif sender == Project:
        customer = structure.customer

    customer_users = customer.get_users()
    customer.set_quota_usage(Customer.Quotas.nc_user_count, customer_users.count())
876735
def account_quotas(options = {})
      batches = Enumerator.new do |y|
        batch = []
        resp = @client.describe_account_attributes(options)
        resp.data.account_quotas.each do |a|
          batch << AccountQuota.new(
            name: a.account_quota_name,
            data: a,
            client: @client
          )
        end
        y.yield(batch)
      end
      AccountQuota::Collection.new(batches)
    end
1122213
def update_quota(self, tenant_id, subnet=None, router=None,
                     network=None, floatingip=None, port=None,
                     sec_grp=None, sec_grp_rule=None):
        '''
        
        '''
        body = {}
        if subnet:
            body['subnet'] = subnet
        if router:
            body['router'] = router
        if network:
            body['network'] = network
        if floatingip:
            body['floatingip'] = floatingip
        if port:
            body['port'] = port
        if sec_grp:
            body['security_group'] = sec_grp
        if sec_grp_rule:
            body['security_group_rule'] = sec_grp_rule
        return self.network_conn.update_quota(tenant_id=tenant_id,
                                              body={'quota': body})
140150
public void setQuota(Path src, long namespaceQuota, long diskspaceQuota) 
                       throws IOException {
    dfs.setQuota(getPathName(src), namespaceQuota, diskspaceQuota);
  }
1125706
def setMaximum(self, maximum):
        
        if not isinstance(maximum, int):
            raise TypeError("Argument is not of type int or long")
        self._maximum = maximum
1002375
def quota(self):
		

		response = self._call(
			mm_calls.ClientState,
			self.uploader_id
		)
		client_state = response.body.clientstate_response

		return (client_state.total_track_count, client_state.locker_track_limit)
797337
def set(self, value, samples=0):
        '''
        
        '''
        if self.params.length > self.pos and samples > 0:
            l = min(samples, self.params.length-self.pos)
            self.data[self.pos:self.pos+l] = np.full(l, value, dtype=np.float)
            self.pos += l
        self.latest = value
        return self
602889
private void checkRateLimit(String quotaKey, Tracked trackedOp) {
        String quotaValue = null;
        try {
            if(!metadataStore.getQuotaEnforcingEnabledUnlocked()) {
                return;
            }
            quotaValue = quotaStore.cacheGet(quotaKey);
            // Store may not have any quotas
            if(quotaValue == null) {
                return;
            }
            // But, if it does
            float currentRate = getThroughput(trackedOp);
            float allowedRate = Float.parseFloat(quotaValue);
            // TODO the histogram should be reasonably accurate to do all
            // these things.. (ghost qps and all)

            // Report the current quota usage level
            quotaStats.reportQuotaUsed(trackedOp, Utils.safeGetPercentage(currentRate, allowedRate));

            // check if we have exceeded rate.
            if(currentRate > allowedRate) {
                quotaStats.reportRateLimitedOp(trackedOp);
                throw new QuotaExceededException("Exceeded rate limit for " + quotaKey
                                                 + ". Maximum allowed : " + allowedRate
                                                 + " Current: " + currentRate);
            }
        } catch(NumberFormatException nfe) {
            // move on, if we cannot parse quota value properly
            logger.debug("Invalid formatting of quota value for key " + quotaKey + " : "
                         + quotaValue);
        }
    }
333373
def quota(ip=None):
    """"""
    # TODO: Add arbitrary user defined IP check
    url = 'http://www.random.org/quota/?format=plain'
    data = urlopen(url)
    credit = int(data.read().strip())
    if data.code == 200:
        return credit
    else:
        return "ERROR: Server responded with code %s" % data.code