Sets the quantity of this OrderLineItem.
        The quantity purchased, as a string representation of a number.  This string must have a positive integer value.

        :param quantity: The quantity of this OrderLineItem.
        :type: str
160381
def quantity(self, quantity):
        

        if quantity is None:
            raise ValueError("Invalid value for `quantity`, must not be `None`")
        if len(quantity) > 5:
            raise ValueError("Invalid value for `quantity`, length must be less than `5`")
        if len(quantity) < 1:
            raise ValueError("Invalid value for `quantity`, length must be greater than or equal to `1`")

        self._quantity = quantity
303245
def compute_quantity(self, quantity):
        
        quantity = quantity.copy()
        expression = self.model.replace(quantity.pop('expression'), self.replacements)
        variables = self.all_variables[len(self.free_variables) + 1:]
        function = self.model.lambdify(expression, variables, **self.lambdify_options)
        quantity['value'] = function(*(self.fitted_parameters + self.fixed_values)) * prefix_factor(quantity)**(-1)
        return quantity
657466
def set_number(self, key, value):
        
        storage = self.storage

        if not isinstance(value, int):
            logger.error("set_number: Value must be an integer")
            return

        try:
            lock.acquire()
            storage[key] = value
        finally:
            self.storage._p_changed = True
            lock.release()

        return storage[key]
909275
def y0(self):
        
        try:
            return self._y0
        except AttributeError:
            self._y0 = Quantity(0, self.yunit)
            return self._y0
967533
def set_quality(self, quality):
        
        if isinstance(quality, *six.string_types):
            quality = int(quality)
        elif isinstance(quality, float):
            quality = int(quality)

        self._quality = validate_type(quality, type(None), *six.integer_types)
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")
1333136
def set_quantity(self, twig=None, value=None, **kwargs):
        
        # TODO: handle twig having parameter key (value@, default_unit@, adjust@, etc)
        # TODO: does this return anything (update the docstring)?
        return self.get_parameter(twig=twig, **kwargs).set_quantity(value=value, **kwargs)
185035
def order(self, order):
        
        if order is None:
            raise ValueError("Invalid value for `order`, must not be `None`")
        allowed_values = ["ASC", "DESC"]
        if order not in allowed_values:
            raise ValueError(
                "Invalid value for `order` ({0}), must be one of {1}"
                .format(order, allowed_values)
            )

        self._order = order
220221
def register_quantity(quantity, name):
    """"""
    x = TypeDefinition(name, (quantity.__class__,), ())
    Validator.types_mapping[name] = x
628373
def setSubTotal( self, amount ):
        
        self._subProgressBar.setValue(0)
        self._subProgressBar.setMaximum(amount)
        if amount:
            self.setShowSubProgress(True)
287708
def add_item(session, item, quantity=1):
        
        shopping_cart = session.get_attribute('shopping_cart')
        if shopping_cart:
            shopping_cart.add_item(item, quantity)
        else:
            shopping_cart = ShoppingCart()
            shopping_cart.add_item(item, quantity)
        session.set_attribute('shopping_cart', shopping_cart)
669806
def setvalue(self, value):
		
		self._value = abs(value)
		self._sign = 0
		if(value < 0):
			self._sign = 1
1194044
def words(self, quantity: int = 5) -> List[str]:
        
        words = self._data['words'].get('normal')
        words_list = [self.random.choice(words) for _ in range(quantity)]
        return words_list
1297148
def sub(self, quantity):
        
        newvalue = self._value - quantity
        self.set(newvalue.deg)
884468
def update_cart(params)
      if order.update_attributes(params)
        order.line_items.select(&:quantity_previously_changed?).each do |line_item|
          Spree::Cart::Event::Tracker.new(
            actor: order, target: line_item, total: order.total, variant_id: line_item.variant_id
          ).track
        end
        # line_items which have 0 quantity will be lost and couldn't be tracked
        # so tracking is done before the execution of next statement
        order.line_items = order.line_items.select { |li| li.quantity > 0 }
        reload_totals
        PromotionHandler::Cart.new(order).activate
        order.ensure_updated_shipments
        reload_totals
        true
      else
        false
      end
    end
1054472
def increment(self, attr, amount=1):
        
        return self.set(attr, operation.Increment(amount))
525025
def create_integer(self, value: int) -> Integer:
        
        self.append((3, value))
        return self.get(self.raw_count - 1)