Asserts that all will flags and quality of service are correct.

@throws MalformedPacketException
488095
private function assertValidWill()
    {
        if ($this->hasWill()) {
            $this->assertValidQosLevel($this->getWillQosLevel(), true);
        } else {
            if ($this->getWillQosLevel() > 0) {
                $this->throwException(
                    sprintf(
                        'Expected a will quality of service level of zero but got %d.',
                        $this->getWillQosLevel()
                    ),
                    true
                );
            }

            if ($this->isWillRetained()) {
                $this->throwException('There is not will but the will retain flag is set.', true);
            }
        }
    }
1350154
protected void checkNode(@Nullable Node node, Token type) throws MalformedException {
    if (node == null) {
      throw new MalformedException(
          "Expected node type " + type + "; found: null", node);
    }
    if (node.getToken() != type) {
      throw new MalformedException(
          "Expected node type " + type + "; found: " + node.getToken(), node);
    }
  }
326352
public final void fail () {
		Status previousStatus = status;
		status = Status.FAILED;
		if (tree.listeners != null && tree.listeners.size > 0) tree.notifyStatusUpdated(this, previousStatus);
		end();
		if (control != null) control.childFail(this);
	}
91275
public function check_validity() {
		foreach ( $this->plugins as $plugin ) {
			/** @var Plugin $plugin */
			if ( $plugin->valid ) {
				// This is valid plugin, so we need check license health.
				$plugin->update_license( $plugin->license, true );
				if ( ! $plugin->fail_limit ) {
				    // If plugin has no fail limit, skip it.
				    continue;
				}
				/**
				 * sekisyo_update_error
				 *
				 * @package sekisyo
				 * @since 1.0.0
				 *
				 * @param string $guid
				 * @param int $failed
				 * @param Plugin $plugin
				 */
				do_action( 'sekisyo_update_error', $plugin->guid, $plugin->failed, $plugin );
				if ( $plugin->failed > $plugin->fail_limit ) {
					$plugin->inactivate();
				}
			}
		}
	}
870043
private function assertValidReturnCode($returnCode, $fromPacket = true)
    {
        if (!in_array($returnCode, [0, 1, 2, 128])) {
            $this->throwException(
                sprintf('Malformed return code %02x.', $returnCode),
                $fromPacket
            );
        }
    }
8169
private function AssertSuccess()
    {
        if ($this->db)
        {
            if ($this->IsConnected())
            {
                $errorCode = $this->db->errno;
                if ($errorCode != 0)
                {
                    if ($this->inTransaction)
                        $this->RollBack();

                    throw new DBExceptions\DatabaseException($this->db->error, $errorCode, $this->lastQuery);
                }
            }
            else
            {
                $errorCode = $this->db->connect_errno;
                if ($errorCode != 0)
                {
                    throw new DBExceptions\DatabaseException($this->db->connect_error, $errorCode);
                }
            }
        }
    }
425866
private void assertInitialized() {

		if (!services.isShuttingDown() && !services.isShutdownDone()) {

			// wait for service layer to be initialized
			while (!services.isInitialized()) {

				try { Thread.sleep(1000); } catch (Throwable t) {}
			}
		}
	}
863380
private synchronized void checkInitialization() throws DevFailed {
        if (initImpl != null) {
            isInitializing = initImpl.isInitInProgress();
        } else {
            isInitializing = false;
        }
        if (isInitializing) {
            throw DevFailedUtils.newDevFailed("CONCURRENT_ERROR", name + " in Init command ");
        }
    }
862180
private function validateStatusCode() {
		if($this->getStatusCode() === self::DHL_ERROR_NO_ERROR && $this->getStatusText() !== 'ok')
			$this->setStatusCode(self::DHL_ERROR_WEAK_WARNING);

		// Fix the DHL-Error Weak-Warning-Bug
		if($this->countLabelData() === 1) {
			// ALWAYS uses the Shipment-Response when only 1
			$this->setStatusCode($this->getLabelData(0)->getStatusCode());
			$this->setStatusText($this->getLabelData(0)->getStatusText());
			$this->setStatusMessage($this->getLabelData(0)->getStatusMessage());
		} else if($this->getStatusCode() === self::DHL_ERROR_WEAK_WARNING) {
			$noError = true;

			// Search in all shipments if an error/warning exists
			foreach($this->getLabelData() as &$labelData) {
				/**
				 * @var LabelData $labelData
				 */
				if($labelData->getStatusCode() !== self::DHL_ERROR_NO_ERROR) {
					$noError = false;
					break;
				}
			}

			if($noError) {
				$this->setStatusCode(self::DHL_ERROR_NO_ERROR);
				$this->setStatusText('ok');
				$this->setStatusMessage('Der Webservice wurde ohne Fehler ausgeführt.');
			}
		}
	}
1031676
public final void assertReady() throws ConfigurationException {
        ArrayList<String> messages = new ArrayList<String>();
        errorCheck(messages);
        int size = messages.size();
        if (size == 0) {
            return;
        }
        StringBuilder b = new StringBuilder();
        if (size > 1) {
            b.append("Multiple problems: ");
        }
        for (int i=0; i<size; i++) {
            if (i > 0) {
                b.append("; ");
            }
            b.append(messages.get(i));
        }
        throw new ConfigurationException(b.toString());
    }
505124
private void assertValidOrderForChecks(List<PassFactory> checks) {
    assertPassOrder(
        checks,
        chromePass,
        checkJsDocAndEs6Modules,
        "The ChromePass must run before after JsDoc and Es6 module checking.");
    assertPassOrder(
        checks,
        closureRewriteModule,
        processDefines,
        "Must rewrite goog.module before processing @define's, so that @defines in modules work.");
    assertPassOrder(
        checks,
        closurePrimitives,
        polymerPass,
        "The Polymer pass must run after goog.provide processing.");
    assertPassOrder(
        checks,
        chromePass,
        polymerPass,
        "The Polymer pass must run after ChromePass processing.");
    assertPassOrder(
        checks,
        polymerPass,
        suspiciousCode,
        "The Polymer pass must run before suspiciousCode processing.");
    assertPassOrder(
        checks,
        dartSuperAccessorsPass,
        TranspilationPasses.es6ConvertSuper,
        "The Dart super accessors pass must run before ES6->ES3 super lowering.");

    if (checks.contains(closureGoogScopeAliases)) {
      checkState(
          checks.contains(checkVariableReferences),
          "goog.scope processing requires variable checking");
    }
    assertPassOrder(
        checks,
        checkVariableReferences,
        closureGoogScopeAliases,
        "Variable checking must happen before goog.scope processing.");

    assertPassOrder(
        checks,
        gatherModuleMetadataPass,
        closureCheckModule,
        "Need to gather module metadata before checking closure modules.");

    assertPassOrder(
        checks,
        gatherModuleMetadataPass,
        createModuleMapPass,
        "Need to gather module metadata before scanning modules.");

    assertPassOrder(
        checks,
        createModuleMapPass,
        rewriteCommonJsModules,
        "Need to gather module information before rewriting CommonJS modules.");

    assertPassOrder(
        checks,
        rewriteScriptsToEs6Modules,
        gatherModuleMetadataPass,
        "Need to gather module information after rewriting scripts to modules.");

    assertPassOrder(
        checks,
        checkClosureImports,
        rewriteClosureImports,
        "Closure imports must be checked before they are rewritten.");

    assertPassOrder(
        checks,
        j2clPass,
        TranspilationPasses.rewriteGenerators,
        "J2CL normalization should be done before generator re-writing.");
  }
189620
public void check()
        throws FatalCompileTimeException
    {
        HashSet declsToCheck = new HashSet();

        //
        // First, build up the Set of declarations to check.  We don't want any duplicates.
        //
        for ( int i = 0; i < _atds.length; ++i )
        {
            AnnotationTypeDeclaration atd = _atds[i];
            Declaration[] decls = getAnnotationProcessorEnvironment().getDeclarationsAnnotatedWith( atd );
            for ( int j = 0; j < decls.length; j++ )
            {
                declsToCheck.add( decls[j] );
            }
        }

        // Now, check the declarations.
        check(declsToCheck);
    }
360556
def verify():
    """"""
    verbose = True
    log(
        "Verifying current directory as a Dallinger experiment...",
        delay=0,
        verbose=verbose,
    )
    ok = verify_package(verbose=verbose)
    if ok:
        log("✓ Everything looks good!", delay=0, verbose=verbose)
    else:
        log("☹ Some problems were found.", delay=0, verbose=verbose)
959950
void markFailed() {
    // It's possible that the dag is killed before this method is called.
    assertRunningOrKilling();
    changeStatus(Status.FAILURE);
    for (final Node child : this.children) {
      child.cancel();
    }
    //todo: HappyRay support failure options "Finish Current Running" and "Cancel All"
    this.dag.updateDagStatus();
  }
744493
public function validate(&$msg = null)
    {
        if ($this->frame instanceof ModificationSetInterface) {
            return true;
        }
        throw new MalformedConfigException($this->getName().
            ' must be inside of a "modificationset".');
    }
1164176
protected function assertPacketFlags($value, $fromPacket = true)
    {
        if ($this->packetFlags !== $value) {
            $this->throwException(
                sprintf(
                    'Expected flags %02x but got %02x.',
                    $value,
                    $this->packetFlags
                ),
                $fromPacket
            );
        }
    }
1322920
public static function checkNeeded(): void
    {
        set_time_limit(0);
        ignore_user_abort(true);
        ini_set('memory_limit', '1G');

        $services_collection = new ServiceEntityRepository;
        $services_collection
            ->setWhereRunning(0)
            ->setWhereAutoStart(1);

        /** @var ServiceEntity $service_entity */
        foreach ($services_collection->getAsArrayOfObjects() as $service_entity) {
            if (NOW - $service_entity->getLastTs() >= $service_entity->getPeriod()) {
                self::run($service_entity->getId());
            }
        }
    }