Sets the stock_status of this Product.


        :param stock_status: The stock_status of this Product.
        :type: str
187576
def stock_status(self, stock_status):
        
        allowed_values = ["available", "alert", "unavailable"]
        if stock_status is not None and stock_status not in allowed_values:
            raise ValueError(
                "Invalid value for `stock_status` ({0}), must be one of {1}"
                .format(stock_status, allowed_values)
            )

        self._stock_status = stock_status
923799
def status(self, status):
        
        allowed_values = ["pending", "awaitingRetry", "successful", "failed"]
        if status is not None and status not in allowed_values:
            raise ValueError(
                "Invalid value for `status` ({0}), must be one of {1}"
                .format(status, allowed_values)
            )

        self._status = status
789562
def new_cast_status(self, status):
        
        self.status = status
        if status:
            self.status_event.set()
641999
private void setStatus(ConnectionStatus status){
        if(LOGGER.isDebugEnabled()){
            LOGGER.debug("Set status to - " + status);
        }
        if(! this.status.equals(status)){
            ConnectionStatus pre = this.status;
            this.status = status;
            eventThread.queueClientEvent(new ClientStatusEvent(pre, status));
        }
    }
619874
def _update_status(self):
        '''  '''
        label = ''
        # label format, based on time - when slow, go to higher-res display
        delta = time.time() - self.start
        if delta > self.timedelta2:
            self.label_fmt = '%5.2f%%'
        elif delta > self.timedelta1:
            self.label_fmt = '%4.1f%%'

        ratio = self.ratio
        if 0 <= ratio < 1:
            if self.label_mode:
                label = self.label_fmt % (ratio * 100)
            if self.oob_error:  # now fixed, reset
                self._first = self.styles[_if](self.icons[_if])
                self._last = self.styles[_il](self.icons[_il])
                self.oob_error = False
                self._comp_style = self.styles[_ic]
                self.done = False
        else:
            if ratio == 1:
                self.done = True
                self._comp_style = self.styles[_id]
                self._last = self.styles[_if](self.icons[_il])
                if self.label_mode:
                    label = '✓' if self.unicode_support else '+'
                if self.oob_error:  # now fixed, reset
                    self._first = self.styles[_if](self.icons[_if])
                    self.oob_error = False

            elif ratio > 1:
                self.done = True
                self.oob_error = True
                if self.unicode_support:
                    self._last = self._err_style('⏵')
                    if self.label_mode:
                        label = '✗'
                else:
                    self._last = self._err_style('>')
                    if self.label_mode:
                        label = 'ERR'
            else:  # < 0
                self.oob_error = True
                if self.unicode_support:
                    self._first = self._err_style('⏴')
                    if self.label_mode:
                        label = '✗'
                else:
                    self._first = self._err_style('<')
                    if self.label_mode:
                        label = 'ERR'
        self._lbl = label
376693
public void setStatusOrder(Status... statusOrder) {
		String[] order = new String[statusOrder.length];
		for (int i = 0; i < statusOrder.length; i++) {
			order[i] = statusOrder[i].getCode();
		}
		setStatusOrder(Arrays.asList(order));
	}
68623
protected function setStatusPriceRule($status)
    {
        $id = $this->getParam(0);
        $all = $this->getParam('all');

        if (!isset($id) && !$all) {
            $this->errorAndExit($this->text('Invalid command'));
        }

        $result = $options = null;

        if (isset($id)) {

            if (empty($id) || !is_numeric($id)) {
                $this->errorAndExit($this->text('Invalid argument'));
            }

            if ($this->getParam('trigger')) {
                $options = array('trigger_id' => $id);
            } else {
                $result = $this->price_rule->update($id, array('status' => $status));
            }

        } else if ($all) {
            $options = array();
        }

        if (isset($options)) {

            $updated = $count = 0;
            foreach ($this->price_rule->getList($options) as $item) {
                $count++;
                $updated += (int) $this->price_rule->update($item['price_rule_id'], array('status' => $status));
            }

            $result = $count && $count == $updated;
        }

        if (empty($result)) {
            $this->errorAndExit($this->text('Unexpected result'));
        }

        $this->output();
    }
175116
def update_status(status)
      if status.present?
        RRRSpec.redis.hset(key, 'status', status)
      else
        RRRSpec.redis.hdel(key, 'status')
      end
    end
1341682
def set_cpu_status(self, status):
        
        assert status in snap7.snap7types.cpu_statuses, 'unknown cpu state %s' % status
        logger.debug("setting cpu status to %s" % status)
        return self.library.Srv_SetCpuStatus(self.pointer, status)
1110450
public function setStatus(\Flowcode\ShopBundle\Entity\ProductOrderStatus $status = null)
    {
        $this->status = $status;

        return $this;
    }
401260
def reduce_stock(self, product_id, sku_info, quantity):
        
        return self._post(
            'merchant/stock/reduce',
            data={
                "product_id": product_id,
                "sku_info": sku_info,
                "quantity": quantity
            }
        )
390853
public function cancelByBuyer()
    {
        $this->setStatusCode(self::STATUS_CANCELED_BY_BUYER);

        // Replace stock
        foreach ($this->getLineItems() as $lineItem)
        {
            $quantity = $lineItem->getQuantity();

            // Increment stock from Product
            $product = $lineItem->getProduct();
            $product->setQuantityOnHold($product->getQuantityOnHold()-$quantity);
            $product->setQuantityAvailable($product->getQuantityAvailable()+$quantity);

            // Create stock transaction for each line item
            $stockTransaction = new OrderStockTransaction();
            $stockTransaction->setQuantity($quantity);
            $stockTransaction->setProduct($product);
            $stockTransaction->setStatusCode(OrderStockTransaction::STATUS_PENDING);

            $lineItem->setStockTransaction($stockTransaction);
        }
    }
385522
def update_status(self, *pargs, **kwargs):
        
        try:
            return super(API, self).update_status(*pargs, **kwargs)

        except tweepy.TweepError as e:
            if getattr(e, 'api_code', None) == 503:
                sleep(10)
                return super(API, self).update_status(*pargs, **kwargs)
            else:
                raise e
553565
def status(self, value):
        
        if self._bug.get('id', None):
            if value in VALID_STATUS:
                self._bug['status'] = value
            else:
                raise BugException("Invalid status type was used")
        else:
            raise BugException("Can not set status unless there is a bug id."
                               " Please call Update() before setting")
855901
def set_status(db, job_id, status):
    
    assert status in (
        'created', 'submitted', 'executing', 'complete', 'aborted', 'failed'
    ), status
    if status in ('created', 'complete', 'failed', 'aborted'):
        is_running = 0
    else:  # 'executing'
        is_running = 1
    if job_id < 0:
        rows = db('SELECT id FROM job ORDER BY id DESC LIMIT ?x', -job_id)
        if not rows:
            return 0
        job_id = rows[-1].id
    cursor = db('UPDATE job SET status=?x, is_running=?x WHERE id=?x',
                status, is_running, job_id)
    return cursor.rowcount
820692
def set_pump_status(self, status):
        
        self.pump_status = status
        _logger.info("%r partition %r", status, self.lease.partition_id)
273821
def set_status(self, status: Status, increment_try_count: bool=True,
                   filename: str=None):
        '''
        '''
        url = self.url_record.url
        assert not self._try_count_incremented, (url, status)

        if increment_try_count:
            self._try_count_incremented = True

        _logger.debug(__('Marking URL {0} status {1}.', url, status))

        url_result = URLResult()
        url_result.filename = filename

        self.app_session.factory['URLTable'].check_in(
            url,
            status,
            increment_try_count=increment_try_count,
            url_result=url_result,
        )

        self._processed = True