Gets if the line item is a real and satisfied promotion line item.
542225
private function isRealPromotionItem(LineItem $lineItem): bool
    {
        if ($lineItem->getType() !== self::LINE_ITEM_TYPE) {
            return false;
        }

        // its a correct line item type, so it can either be
        // a placeholder or a real one.
        return !$this->isPromotionPlaceholder($lineItem);
    }
138868
def successful(self):
        """"""
        status = self.status
        assert status >= COMPLETED, "status is %s" % status
        return (self.status == COMPLETED)
331700
function show_notice() {
		if ( ! is_admin() ) {
			return false;
		}
		$status                = $this->get_license_status();
		$no_activations_string = apply_filters( $this->product->get_key() . '_lc_no_activations_string', 'No activations left for %s !!!. You need to upgrade your plan in order to use %s on more websites. Please ask the %s Staff for more details.' );
		$no_valid_string       = apply_filters( $this->product->get_key() . '_lc_no_valid_string', 'In order to benefit from updates and support for %s, please add your license code from your  <a href="%s" target="_blank">purchase history</a> and validate it <a href="%s">here</a>. ' );
		$expiration_string     = apply_filters( $this->product->get_key() . '_lc_expiration_string', 'Your license is about to expire for %s. You can go to %s and renew it   ' );

		// No activations left for this license.
		if ( 'valid' != $status && $this->check_activation() ) {
			?>
			<div class="error">
				<p><strong>
						<?php
						echo sprintf(
							$no_activations_string,
							$this->product->get_name(),
							$this->product->get_name(),
							'<a href="' . $this->get_api_url() . '" target="_blank">' . $this->get_distributor_name() . '</a>'
						);
						?>
					</strong>
				</p>
			</div>
			<?php
			return false;
		}
		// Invalid license key.
		if ( 'valid' != $status ) {
			?>
			<div class="error">
				<p>
					<strong><?php echo sprintf( $no_valid_string, $this->product->get_name() . ' ' . $this->product->get_type(), $this->get_api_url(), admin_url( 'options-general.php' ) . '#' . $this->product->get_key() ); ?> </strong>
				</p>
			</div>
			<?php

			return false;
		}

		// Expired and soon to expire license.
		if ( 'valid' == $status && $this->check_expiration() ) {
			?>
			<div class="update-nag">
				<p>
					<strong>
						<?php
						echo sprintf(
							$expiration_string,
							$this->product->get_name() . ' ' . $this->product->get_type(),
							'<a href="' . $this->renew_url() . '" target="_blank">' . $this->get_distributor_name() . '</a>'
						);
						?>
					</strong>
				</p>
			</div>
			<?php
			return false;
		}

		return true;
	}
1114185
public boolean hasNext() {

        if (items != null) {
            if (items.hasNext()) {
                return (true);
            } else {
                items = null;
            }
        }
        Object next = findNextValidChild();
        while (next != null) {
            initializeItems(next);
            if (items != null) {
                return true;
            } else {
                next = findNextValidChild();
            }
        }
        return false;

    }
456929
private boolean shouldItemIconsBeShown() {
        SharedPreferences sharedPreferences =
                PreferenceManager.getDefaultSharedPreferences(getActivity());
        String key = getString(R.string.show_item_icons_preference_key);
        boolean defaultValue =
                getResources().getBoolean(R.bool.show_item_icons_preference_default_value);
        return sharedPreferences.getBoolean(key, defaultValue);
    }
984205
protected function validateSkuProduct()
    {
        $field = 'sku';

        if ($this->isExcluded($field) || $this->isError()) {
            return null;
        }

        $value = $this->getSubmitted($field);
        $label = $this->translation->text('SKU');

        if ($this->isUpdating() && empty($value)) {
            $data = $this->getSubmitted();
            $value = $this->product->generateSku($data);
            $this->setSubmitted('sku', $value);
        }

        if (isset($value) && mb_strlen($value) > 255) {
            $this->setErrorLengthRange($field, $label, 0, 255);
            return false;
        }

        if (!empty($value)) {
            $this->processed_skus[$value] = true;
        }

        $updating = $this->getUpdating();

        if (isset($updating['sku']) && $updating['sku'] === $value) {
            return true;
        }

        $product_id = null;

        if (isset($updating['product_id'])) {
            $product_id = $updating['product_id'];
        }

        $store_id = $this->getSubmitted('store_id');

        if (isset($updating['store_id'])) {
            $store_id = $updating['store_id'];
        }

        $existing = $this->sku->get(array('sku' => $value, 'store_id' => $store_id));

        if (isset($product_id) && isset($existing['product_id']) && $existing['product_id'] == $product_id) {
            return true;
        }

        if (!empty($existing)) {
            $this->setErrorExists($field, $label);
            return false;
        }

        return true;
    }
281419
public function isArticleValid()
    {
        $valid = true;
        if ($this->isArticleAmountZero() || $this->isSameItemInBasket()) {
            $valid = false;
        }

        return $valid;
    }
41574
function success(item, ctx) {
		item.count++;

		if (item.state === C.CIRCUIT_HALF_OPEN_WAIT)
			circuitClose(item, ctx);
		else
			checkThreshold(item, ctx);
	}
119794
static final HllSketchImpl promoteHeapListOrSetToHll(final CouponList src) {
    final HllArray tgtHllArr = HllArray.newHeapHll(src.lgConfigK, src.tgtHllType);
    final PairIterator srcItr = src.iterator();
    tgtHllArr.putKxQ0(1 << src.lgConfigK);
    while (srcItr.nextValid()) {
      tgtHllArr.couponUpdate(srcItr.getPair());
    }
    tgtHllArr.putHipAccum(src.getEstimate());

    tgtHllArr.putOutOfOrderFlag(false);
    return tgtHllArr;
  }
383708
public function hasItems()
    {
        if (count($this->data[1]) === 0) {
            return;
        }
        foreach ($this->data[1] as $key => $value) {
            $this->failIf(
                !$this->itemExists(
                    array($this->data[0], array($key => $value))
                )
            );
        }
    }
172956
public function isSuccessful()
    {
        # Validate the Hash
        $hashSecretWord = $this->data['secretWord']; # Input your secret word
        $hashSid = $this->data['accountNumber']; #Input your seller ID (2Checkout account number)
        $hashOrder = $this->data['sale_id'];
        $hashInvoice = $this->data['invoice_id'];
        $StringToHash = strtoupper(md5($hashOrder.$hashSid.$hashInvoice.$hashSecretWord));

        return $StringToHash == $this->data['md5_hash'];
    }
871108
def fulfill(order_id, shipping_address, line_items, options = {})
      commit :fulfillment, build_fulfillment_request(order_id, shipping_address, line_items, options)
    end
521747
function itemIsValid(item) {
    if (!('isValid' in item)) {
      return true;
    }
    if (_.isFunction(item.isValid)) {
      return item.isValid();
    }
    return false;
  }
333303
private function checkProduct(){
		$product =  explode('/',trim($this->data[0]));
		if (count($product) !== 2) {
			return false;	
		}
		list($this->report['product'], $this->report['productVersion']) =$product;
		unset($this->data[0]);
		$this->data = $this->reindex($this->data);
		return true;
	}
293100
def is_real(arg):
    '''
    
    '''
    return (is_real(mag(arg)) if is_quantity(arg)       else
            True              if isinstance(arg, float) else
            is_npscalar(arg, 'real') or is_npvalue(arg, 'real'))
1333374
public static function find_ltiservice_gradebookservice_for_lineitem($lineitemid) {
        global $DB;

        if (!$lineitemid) {
            return false;
        }
        $gradeitem = $DB->get_record('grade_items', array('id' => $lineitemid));
        if ($gradeitem) {
            $gbs = $DB->get_record('ltiservice_gradebookservices',
                    array('gradeitemid' => $gradeitem->id, 'courseid' => $gradeitem->courseid));
            if ($gbs) {
                return $gbs;
            } else {
                return false;
            }
        } else {
            return false;
        }
    }
919194
public function checkItemIsActive($item)
    {
        if ($this->getActive()) {
            return true;
        }

        if (empty($item_list = $item->getHideIfItemNotActiveOption())) {
            return true;
        }

        if (!is_array($item_list)) {
            $item_list = [$item_list];
        }

        foreach ($item_list as $nickname) {
            $check_item = $item->getMenu()->get($nickname);

            if (!is_null($check_item) && $check_item->getActive()) {
                return true;
            }
        }

        return false;
    }