Test wheever or not a feature is supported
@param string $feature
@throws common_exception_Error if feature is unkown
@return boolean
180489
public function supportsFeature($feature)
    {
        switch ($feature) {
            case self::FEATURE_NX:
                return ($this->getDriver() instanceof common_persistence_KeyValue_Nx);
            default:
                throw new common_exception_Error('Unknown feature '.$feature);
        }
        return false;
    }
1361378
public function isScenarioMatch(FeatureNode $feature, ScenarioInterface $scenario)
    {
        return $this->isTagsMatchCondition(array_merge($feature->getTags(), $scenario->getTags()));
    }
821476
protected function checkRequirements($mode)
    {
        if (true !== in_array($mode, self::$validModes, true)) {
            throw new Exception(
                sprintf('Mode "%s" not supported. Supported: "%s"', $mode, var_export(self::$validModes, true))
            );
        }

        switch ($mode) {
            case self::MODE_OPEN_SSL:
            case self::MODE_PHP_DEFAULT:
            case self::MODE_PHP_MERSENNE_TWISTER:
            default:
                // Intentionally omitted cause not required - listed here for code quality and readability
                break;
        }

        return true;
    }
1140085
public function isValid($value)
    {
        if (!$value instanceof ApplicationInterface) {
            $this->error('NO_APPLICATION');

            return false;
        }

        $error = false;

        if ('' == $value->getContact()->getEmail()) {
            $error = true;
            $this->error('NO_EMAIL');
        }

        if (!$value->getAttributes()->getAcceptedPrivacyPolicy()) {
            $error = true;
            $this->error('NO_ACCEPT_PP');
        }

        return !$error;
    }
63283
public static <S> void assertThat(S subject, Feature<? super S,Boolean> feature) {
        assertThat(subject, feature, isQuietlyTrue());
    }
957154
public static function assertIsNumber($variable, Throwable $exception): bool
    {
        static::makeAssertion(\is_int($variable) || \is_float($variable), $exception);
        return true;
    }
1353539
public static function checkGD($throwException = true): bool
    {
        $isGd = extension_loaded('gd');

        // Require GD library
        if ($throwException && !$isGd) {
            throw new Exception('Required extension GD is not loaded.'); // @codeCoverageIgnore
        }

        return $isGd;
    }
39350
public function checkProperty(&$property)
    {
        if (parent::checkProperty($property)) {
            if (preg_match(
                '/^(?:src|unicode-range|font-(?:family|variant|feature-settings|stretch|weight|style))$/D',
                $property)) {
                return true;
            } else {
                $this->setIsValid(false);
                $this->addValidationError("Invalid property '$property' for @font-face declaration.");
            }
        }

        return false;
    }
780970
public function canSendHeaders($throw = false)
        {
            $ok = headers_sent($file, $line);

            if ($ok && $throw && $this->headersSentThrowsException) {
                throw new Exception('Cannot send headers; headers already sent in ' . $file . ', line ' . $line);
            }

            return !$ok;
        }
1107485
public function HasFeature($Feature) {
      return isset($this->Features[$Feature]) ? $this->Features[$Feature] : Gdn_Cache::CACHEOP_FAILURE;
   }
450920
public static function assertIsString($variable, Throwable $exception): bool
    {
        static::makeAssertion(\is_string($variable), $exception);
        return true;
    }
336434
private static function mandatory($feature) {
        if ($feature->getParent() && $feature->getMandatory())
            return Logic::equiv(Logic::is($feature), Logic::is($feature->getParent()));
    }
945499
def validate_feature (name):
    
    assert isinstance(name, basestring)
    if name not in __all_features:
        raise InvalidFeature ("'%s' is not a valid feature name" % name)
    else:
        return __all_features[name]
1352520
protected function shouldntReport(Throwable $error): bool
    {
        if (!($error instanceof \Exception)) {
            return false;
        }

        foreach ($this->dontReport as $type) {
            if ($error instanceof $type) {
                return true;
            }
        }

        return false;
    }
1231472
public function isFeatureMatch(FeatureNode $feature)
    {
        if ('/' === $this->filterString[0]) {
            return 1 === preg_match($this->filterString, $feature->getTitle());
        }

        return false !== mb_strpos($feature->getTitle(), $this->filterString, 0, 'utf8');
    }
869470
public static function hasFeature($jname, $feature) {
        $return = false;
	    $admin = Factory::getAdmin($jname);
	    $user = Factory::getUser($jname);
        switch ($feature) {
            //Admin Features
            case 'wizard':
	            $return = $admin->methodDefined('setupFromPath');
                break;
            //User Features
            case 'useractivity':
                $return = $user->methodDefined('activateUser');
                break;
            case 'duallogin':
                $return = $user->methodDefined('createSession');
                break;
            case 'duallogout':
                $return = $user->methodDefined('destroySession');
                break;
            case 'updatepassword':
                $return = $user->methodDefined('updatePassword');
                break;
            case 'updateusername':
                $return = $user->methodDefined('updateUsername');
                break;
            case 'updateemail':
                $return = $user->methodDefined('updateEmail');
                break;
            case 'updateusergroup':
                $return = $user->methodDefined('updateUsergroup');
                break;
            case 'updateuserlanguage':
                $return = $user->methodDefined('updateUserLanguage');
                break;
            case 'syncsessions':
                $return = $user->methodDefined('syncSessions');
                break;
            case 'blockuser':
                $return = $user->methodDefined('blockUser');
                break;
            case 'activateuser':
                $return = $user->methodDefined('activateUser');
                break;
            case 'deleteuser':
                $return = $user->methodDefined('deleteUser');
                break;
        }
        return $return;
    }
1210759
public static function assertNotTrue($condition, Throwable $exception): bool
    {
        static::makeAssertion(true !== $condition, $exception);
        return false;
    }