Returns the configuration's value for a value feature.
@param ValueFeature $feature
@return string
187426
public function getValue($feature) {
        // side effect: checks for instanceof ValueFeature
        $defaultValue = $feature->getDefaultValue();
        $values = $this->xmlConfiguration->getValues();
        if (array_key_exists($feature->getName(), $values))
            return $values[$feature->getName()];
        else
            return $defaultValue;
    }
1035928
public function filterFeature(FeatureNode $feature)
    {
        $scenarios = array();
        foreach ($feature->getScenarios() as $scenario) {
            if (!$this->isScenarioMatch($scenario)) {
                continue;
            }

            if ($scenario instanceof OutlineNode && $scenario->hasExamples()) {
                $table = $scenario->getExampleTable()->getTable();
                $lines = array_keys($table);

                $filteredTable = array($lines[0] => $table[$lines[0]]);
                unset($table[$lines[0]]);

                foreach ($table as $line => $row) {
                    if ($this->filterMinLine <= $line && $this->filterMaxLine >= $line) {
                        $filteredTable[$line] = $row;
                    }
                }

                $scenario = new OutlineNode(
                    $scenario->getTitle(),
                    $scenario->getTags(),
                    $scenario->getSteps(),
                    new ExampleTableNode($filteredTable, $scenario->getExampleTable()->getKeyword()),
                    $scenario->getKeyword(),
                    $scenario->getLine()
                );
            }

            $scenarios[] = $scenario;
        }

        return new FeatureNode(
            $feature->getTitle(),
            $feature->getDescription(),
            $feature->getTags(),
            $feature->getBackground(),
            $scenarios,
            $feature->getKeyword(),
            $feature->getLanguage(),
            $feature->getFile(),
            $feature->getLine()
        );
    }
1133408
protected function getConfigModel($valueMask = true)
    {
        if (!$this->_configModel) {
            $model = new \MUtil_Model_TableModel('gems__radius_config', 'config');
            // $model = new \Gems_Model_JoinModel('config', 'gems__radius_config', 'grcfg');

            $model->setIfExists('grcfg_ip', 'label', $this->translate->_('IP address'), 'required', true);
            $model->setIfExists('grcfg_port', 'label', $this->translate->_('Port'), 'required', true);
            $model->setIfExists('grcfg_secret',
                    'label', $this->translate->_('Shared secret'),
                    'description', $this->translate->_('Enter only when changing'),
                    'elementClass', 'password',
                    'required', false,
                    'repeatLabel', $this->translate->_('Repeat password')
                    );

            $type = new \Gems_Model_Type_EncryptedField($this->project, $valueMask);
            $type->apply($model, 'grcfg_secret');

            $this->_configModel = $model;
        }

        return $this->_configModel;
    }
989148
function(feature) {
        if (!feature) return null;

        var featureName = feature.eClass ? feature.get('name') : feature;

        if (!_.has(this.values, featureName) && this.has(featureName)) {
            initValue(this, getEStructuralFeature(this.eClass, featureName));
        }

        var value = this.values[featureName];

        if (typeof value === 'function') {
            return value.apply(this);
        } else {
            return value;
        }
    }
1144071
public function isSupported(string $feature): bool
    {
        if (!array_key_exists($feature, $this->supported)) {
            if (!isset($this->features[$feature])) {
                throw new UndefinedFeatureException($feature);
            }

            $this->supported[$feature] =
                (bool) $this->features[$feature]($this);
        }

        return $this->supported[$feature];
    }
1154918
public function remainings($feature)
    {
        return ((int) $this->value($feature) - (int) $this->consumed($feature));
    }
984895
public function get_config($property) {
        if (property_exists($this->config, $property)) {
            return $this->config->$property;
        }
        throw new \coding_exception('Config property "' . $property . '" doesn\'t exist');
    }
739308
public function setFeatureId($v)
    {
        if ($v !== null) {
            $v = (int) $v;
        }

        if ($this->feature_id !== $v) {
            $this->feature_id = $v;
            $this->modifiedColumns[FeatureFeatureTypeTableMap::FEATURE_ID] = true;
        }

        if ($this->aFeature !== null && $this->aFeature->getId() !== $v) {
            $this->aFeature = null;
        }


        return $this;
    }
1011600
public function setVariable($key, $value, $feature = null)
    {
        $this->variables[$key] = $value;

        $this->set($key, $value, $feature);

        return $this;
    }
1096012
public function configValue(string $key, $valueDefault = null)
    {
        return $this->config->get($key, $valueDefault);
    }
443263
public function canUse($feature)
    {
        // Get features and usage
        $feature_value = $this->value($feature);

        if (is_null($feature_value)) {
            return false;
        }

        // Match "booleans" type value
        if ($this->enabled($feature) === true) {
            return true;
        }

        // If the feature value is zero, let's return false
        // since there's no uses available. (useful to disable
        // countable features)
        if ($feature_value === '0') {
            return false;
        }

        // Check for available uses
        return $this->remainings($feature) > 0;
    }
787872
public int getFeaturePosition(AbstractFeature feature) {
        AbstractFeature result = feature;
        if (!featurePositions.containsKey(feature)) {
            if (feature instanceof FeatureGroup) {
                FeatureGroup featureGroup = (FeatureGroup) feature;
                List<Feature> features = featureGroup.getConcreteFeatures();
                if (!features.isEmpty()) {
                    Collections.sort(features, new Comparator<Feature>() {
                        @Override
                        public int compare(Feature feat1, Feature feat2) {
                            return getFeaturePosition(feat1) - getFeaturePosition(feat2);
                        }
                    });
                    result = features.get(0);
                }
            }
        }
        return featurePositions.getOrDefault(result, 0);
    }
891785
def to_feature(value):
  """"""
  if isinstance(value, FeatureConnector):
    return value
  elif utils.is_dtype(value):  # tf.int32, tf.string,...
    return Tensor(shape=(), dtype=tf.as_dtype(value))
  elif isinstance(value, dict):
    return FeaturesDict(value)
  else:
    raise ValueError('Feature not supported: {}'.format(value))
884186
protected function returnStatusFromFeature(FeatureInterface $feature)
    {
        $status = $feature->getStatus();

        $this->logger->info('Feature {feature} returned as {status} due to {provider} provider', [
            'feature'  => $feature->getName(),
            'status'   => Status::$messages[$status],
            'provider' => $feature->getProvider()->getName()
        ]);

        return $status;
    }
749667
public function setFeature($feature, $value = false, $group = '')
    {
        $this->_aFeatures[$feature] = $value;
        if (!empty($group)) {
            $this->setGroup($group, $feature);
        }
        return $this;
    }
446871
public function setFeature(\Dywee\ProductBundle\Entity\Feature $feature = null)
    {
        $this->feature = $feature;

        return $this;
    }
398939
public function isFeatureEnabled($context, $feature)
    {
        if ($this->hasContext($context) &&
            false !== array_search($feature, $this->getFeaturesForContext($context))
        ) {
            return true;
        }

        return false;
    }