Sets the based_on of this TaxRate.


        :param based_on: The based_on of this TaxRate.
        :type: str
963152
def based_on(self, based_on):
        
        allowed_values = ["shippingAddress", "billingAddress"]
        if based_on is not None and based_on not in allowed_values:
            raise ValueError(
                "Invalid value for `based_on` ({0}), must be one of {1}"
                .format(based_on, allowed_values)
            )

        self._based_on = based_on
772856
def clear_based_on_grades(self):
        
        # Implemented from template for osid.resource.ResourceForm.clear_group_template
        if (self.get_based_on_grades_metadata().is_read_only() or
                self.get_based_on_grades_metadata().is_required()):
            raise errors.NoAccess()
        self._my_map['basedOnGrades'] = self._based_on_grades_default
956987
public function setTaxRate( $taxrate )
	{
		if ( $taxrate == $this->getTaxRate() ) { return; }

		$this->_checkPrice( $taxrate );

		$this->_values['taxrate'] = $this->_formatNumber( $taxrate );
		$this->setModified();
	}
1012
def set(self, name, value):
        
        curr = self.values
        parts = name.split('.')

        for i, part in enumerate(parts[:-1]):
            try:
                curr = curr.setdefault(part, {})
            except AttributeError:
                raise InvalidPath('.'.join(parts[:i + 1]))

        try:
            curr[parts[-1]] = value
        except TypeError:
            raise InvalidPath('.'.join(parts[:-1]))
771869
def __set_rate_type(self, value):
        '''
        
        '''
        if value not in [RATE_TYPE_FIXED, RATE_TYPE_PERCENTAGE]:
            raise ValueError("Invalid rate type.")

        self.__rate_type = value
473962
def raise_on_invalid(self, setting=True, **overrides):
        """"""
        return self.where(raise_on_invalid=setting, **overrides)
279719
def set(self, **kwargs):
        '''
        
        '''
        for lower_key, value in kwargs.items():
            if lower_key.lower() != lower_key:
                raise ValueError('Requires lowercase: %s' % lower_key)
            key = lower_key.upper()
            try:
                getattr(self, key)
            except (AttributeError, ConfigurationError):
                raise AttributeError('Cannot override %s' % key)
            self.overridden_settings[key] = value
444005
def _set(self, **kwargs):
        
        for param, value in kwargs.items():
            p = getattr(self, param)
            if value is not None:
                try:
                    value = p.typeConverter(value)
                except TypeError as e:
                    raise TypeError('Invalid param value given for param "%s". %s' % (p.name, e))
            self._paramMap[p] = value
        return self
1331954
def save(self, *args, **kwargs):
        
        # auto fill updated field with current time unless explicitly disabled
        auto_update = kwargs.get('auto_update', True)
        if auto_update:
            self.updated = now()

        # remove eventual auto_update
        if 'auto_update' in kwargs:
            kwargs.pop('auto_update')

        super(BaseDate, self).save(*args, **kwargs)
933994
def set_filters(query, base_filters):
    
    filters = [f for f in base_filters if f is not None]
    query_filter = query['query']['filtered'].get('filter', None)
    if query_filter is not None:
        if 'and' in query_filter:
            filters.extend(query_filter['and'])
        else:
            filters.append(query_filter)
    if filters:
        query['query']['filtered']['filter'] = {'and': filters}
735937
def set(self, *raw_args, **raw_kwargs):
        
        if self.set_data_kwarg in raw_kwargs:
            data = raw_kwargs.pop(self.set_data_kwarg)
        else:
            raw_args = list(raw_args)
            data = raw_args.pop()

        args = self.prepare_args(*raw_args)
        kwargs = self.prepare_kwargs(**raw_kwargs)

        key = self.key(*args, **kwargs)

        expiry = self.expiry(*args, **kwargs)

        logger.debug("Setting %s cache with key '%s', args '%r', kwargs '%r', expiry '%r'",
                     self.class_path, key, args, kwargs, expiry)

        self.store(key, expiry, data)
1061990
def set_scale_base_xy(self, scale_x_base, scale_y_base):
        
        self.t_.set(scale_x_base=scale_x_base, scale_y_base=scale_y_base)
149614
def set_value(self, value):
        
        parsed_value = self._parse_value(value)
        self.value = parsed_value
669806
def setvalue(self, value):
		
		self._value = abs(value)
		self._sign = 0
		if(value < 0):
			self._sign = 1
504200
def calculation_phase=(calculation_phase)
      validator = EnumAttributeValidator.new('String', ["TAX_SUBTOTAL_PHASE", "TAX_TOTAL_PHASE"])
      unless validator.valid?(calculation_phase)
        fail ArgumentError, "invalid value for 'calculation_phase', must be one of #{validator.allowable_values}."
      end
      @calculation_phase = calculation_phase
    end
791135
def set_data(self, data):
        

        if not isinstance(data, basestring):
            raise ValueError("data must an instance of basestring")
        self._data = data
        self._current = 0
221097
def set_property(self, **kwargs):
        
        if not isinstance(self._value, nparray.ndarray):
            raise ValueError("value is not a nparray object")

        for property, value in kwargs.items():
            setattr(self._value, property, value)