Sets the rate type.
        @param value:str
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
290862
def set_type(self,type):
    
    self.add_var_opt('type',str(type))
    self.__type = str(type)
    self.__set_output()
898815
def set(self, value):
        

        if not isinstance(value, int_types):
            raise TypeError(unwrap(
                '''
                %s value must be an integer, not %s
                ''',
                type_name(self),
                type_name(value)
            ))

        self._native = value
        self.contents = int_to_bytes(value, signed=False)
        self._header = None
        if self._indefinite:
            self._indefinite = False
            self.method = 0
        if self._trailer != b'':
            self._trailer = b''
1052507
def file_type(self, value):
        
        if isinstance(value, FileType):
            self._file_type = value
        else:
            self._file_type = FileType(value)
200692
def datatype(self, value):
        
        self._datatype = self.validate_datatype(value)
        self._cutout_ready = True
991574
def set(self, value):
        
        # check a few things up front
        if not isinstance(value, self.TYPES[self.type]['type']):
            badtype = type(value).__name__
            raise BadRequest('Invalid value for %s: a %s is required, not %s' % (self.id, self.type, badtype))
        if self.enumValues and value not in self.enumValues:
            raise BadRequest('Invalid value for %s: %s not in %s' % (self.id, value, list(self.enumValues)))
        # store value off to the side until we call settings.save()
        tostr = self.TYPES[self.type]['tostr']
        self._setValue = tostr(value)
759485
def fade_speed(self, value):
        

        if value is not None:
            assert type(value) is float, "'{0}' attribute: '{1}' type is not 'float'!".format("fade_speed", value)
            assert value >= 0, "'{0}' attribute: '{1}' need to be exactly positive!".format("fade_speed", value)
        self.__fade_speed = value
257132
@SuppressWarnings("unchecked") private Object formatType(DataType type, Object value)
   {
      switch (type)
      {
         case DATE:
         {
            value = formatDateTime(value);
            break;
         }

         case CURRENCY:
         {
            value = formatCurrency((Number) value);
            break;
         }

         case UNITS:
         {
            value = formatUnits((Number) value);
            break;
         }

         case PERCENTAGE:
         {
            value = formatPercentage((Number) value);
            break;
         }

         case ACCRUE:
         {
            value = formatAccrueType((AccrueType) value);
            break;
         }

         case CONSTRAINT:
         {
            value = formatConstraintType((ConstraintType) value);
            break;
         }

         case WORK:
         case DURATION:
         {
            value = formatDuration(value);
            break;
         }

         case RATE:
         {
            value = formatRate((Rate) value);
            break;
         }

         case PRIORITY:
         {
            value = formatPriority((Priority) value);
            break;
         }

         case RELATION_LIST:
         {
            value = formatRelationList((List<Relation>) value);
            break;
         }

         case TASK_TYPE:
         {
            value = formatTaskType((TaskType) value);
            break;
         }

         default:
         {
            break;
         }
      }

      return (value);
   }
829784
def type(self, value):
        

        self._type = None
        if value is None:
            return

        value = value.upper()
        if value in MOC_TYPES:
            self._type = value
        else:
            raise ValueError('MOC type must be one of ' + ', '.join(MOC_TYPES))
1368855
protected void setValue(Object value) {
        this.value = value;
        serializedValue = null;
        timeStamp = System.currentTimeMillis();
        this.valueHashcode = 0;
    }
1076525
def __set_unit_price(self, value):
        '''
        
        '''
        try:
            if value < 0:
                raise ValueError()

            self.__unit_price = Decimal(str(value))
        except ValueError:
            raise ValueError("Unit Price must be a positive number")
627225
public void setRate(com.google.api.ads.admanager.axis.v201805.Money rate) {
        this.rate = rate;
    }
779607
def set(self, value):
        

        if not isinstance(value, str_cls):
            raise TypeError(unwrap(
                '''
                %s value must be a unicode string, not %s
                ''',
                type_name(self),
                type_name(value)
            ))

        self._unicode = value
        self.contents = iri_to_uri(value)
        self._header = None
        if self._trailer != b'':
            self._trailer = b''
1187482
def settings(self, value):
        

        if value is not None:
            assert type(value) is dict, "'{0}' attribute: '{1}' type is not 'dict'!".format("settings", value)
        self.__settings = foundations.data_structures.Structure(**{"case_sensitive": False,
                                                                   "whole_word": False,
                                                                   "regular_expressions": False})
        self.__settings.update(value)
432392
async def set(self, key, value):
        
        if not check_dht_value_type(value):
            raise TypeError(
                "Value must be of type int, float, bool, str, or bytes"
            )
        log.info("setting '%s' = '%s' on network", key, value)
        dkey = digest(key)
        return await self.set_digest(dkey, value)
745216
def setValue(self, value):
        
        self.__value = projex.text.decoded(value) if isinstance(value, (str, unicode)) else value
1170379
def _set_unicode(self, value):
        
        values = list(self.unicodes)
        if value in values:
            values.remove(value)
        values.insert(0, value)
        self.unicodes = values