This will map the Features into their keys
@param feature
@return String
19520
private String getFeatureKey(CoreScriptFeature feature)
    {
        switch (feature.getIntValue()) {
            case CoreScriptFeature.INT_ANCHOR_SUBMIT:
                return "anchorFormSubmit";
            case CoreScriptFeature.INT_SET_FOCUS:
                return "setFocus";
            case CoreScriptFeature.INT_POPUP_OPEN:
                return "popupSupportPopupWindow";
            case CoreScriptFeature.INT_POPUP_DONE:
                return "popupDone";
            case CoreScriptFeature.INT_POPUP_UPDATE_FORM:
                return "popupSupportUpdateForm";
            case CoreScriptFeature.INT_ROLLOVER:
                return "rollover";
            case CoreScriptFeature.INT_TREE_INIT:
                return "initTree";
            case CoreScriptFeature.INT_AJAX_PREFIX:
                return "initTreePrefix";
            case CoreScriptFeature.INT_AJAX_PARAM:
                return "initTreeParam";
            case CoreScriptFeature.INT_DIVPANEL_INIT:
                return "initDivPanel";
            case CoreScriptFeature.INT_DYNAMIC_INIT:
                return "writeWebAppName";
            case CoreScriptFeature.INT_BUTTON_DISABLE_AND_SUBMIT:
                return "buttonDisableAndSubmitForm";
            case CoreScriptFeature.INT_BUTTON_DISABLE:
                return "buttonDisable";
        }
        assert(false) : "getFeature fell through on feature:" + feature;
        return null;
    }
68180
private FeatureInfo getFeatureInfo(String name,
                                       Map<String, ProductInfo> productInfos,
                                       Map<String, FeatureInfo> featuresBySymbolicName) {
        String productName, featureName;
        int index = name.indexOf(':');
        if (index == -1) {
            FeatureInfo featureInfo = featuresBySymbolicName.get(name);
            if (featureInfo != null) {
                return featureInfo;
            }

            productName = ManifestFileProcessor.CORE_PRODUCT_NAME;
            featureName = name;
        } else {
            productName = name.substring(0, index);
            featureName = name.substring(index + 1);
        }

        ProductInfo product = productInfos.get(productName);
        return product == null ? null : product.featuresByShortName.get(featureName);
    }
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');
    }
576287
def get_values (feature, properties):
    
    if feature[0] != '<':
     feature = '<' + feature + '>'
    result = []
    for p in properties:
        if get_grist (p) == feature:
            result.append (replace_grist (p, ''))

    return result
664792
def convert_feature_layers_to_dict(feature_layers):
    """"""
    features_by_layer = {}
    for feature_layer in feature_layers:
        layer_name = feature_layer['name']
        features = feature_layer['features']
        features_by_layer[layer_name] = features
    return features_by_layer
1011600
public function setVariable($key, $value, $feature = null)
    {
        $this->variables[$key] = $value;

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

        return $this;
    }
866965
public JSON with(Feature ... features)
    {
        int flags = _features;
        for (Feature feature : features) {
            flags |= feature.mask();
        }
        return _with(flags);
    }
1358352
public function get_clean_feature_key_and_path($featurepath) {
        global $CFG;

        // Fix directory path.
        $featurepath = testing_cli_fix_directory_separator($featurepath);
        $dirroot = testing_cli_fix_directory_separator($CFG->dirroot . DIRECTORY_SEPARATOR);

        $key = basename($featurepath, '.feature');

        // Get relative path.
        $featuredirname = str_replace($dirroot , '', $featurepath);
        // Get 5 levels of feature path to ensure we have a unique key.
        for ($i = 0; $i < 5; $i++) {
            if (($featuredirname = dirname($featuredirname)) && $featuredirname !== '.') {
                if ($basename = basename($featuredirname)) {
                    $key .= '_' . $basename;
                }
            }
        }

        return array($key, $featurepath);
    }
912338
public function hasFeature($feature)
    {
        $feature = strtoupper($feature);

        if (!isset($this->features[$feature])) {
            return null;
        }

        return $this->features[$feature];
    }
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;
    }
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))
566390
function(features) {
            if (!(features instanceof Array)) {
                features = [features];
            }
            var result = this.toTriangles().map(function(triPoly) {
                    return triPoly.getTetraFeatures(features);
                })
                .reduce(function(pv, v) {
                    return v.map(function(feat, i) {
                        return feat + (pv === 0 ? 0 : pv[i]);
                    });
                }, 0);
            return (result.length == 1) ? result[0] : result;
        }
250106
private String getLongDescription(ProvisioningFeatureDefinition feature) {
        EsaDescriptionHtmlGenerator generator = new EsaDescriptionHtmlGenerator();
        return generator.generateDescriptionHtml(feature, generateKnowledgeCentreLinks, licenseType);
    }
511117
def _format_feature(feature, weight, hl_spaces):
    # type: (...) -> str
    
    if isinstance(feature, FormattedFeatureName):
        return feature.format()
    elif (isinstance(feature, list) and
            all('name' in x and 'sign' in x for x in feature)):
        return _format_unhashed_feature(feature, weight, hl_spaces=hl_spaces)
    else:
        return _format_single_feature(feature, weight, hl_spaces=hl_spaces)
339764
def get (self, feature):
        
        if type(feature) == type([]):
            feature = feature[0]
        if not isinstance(feature, b2.build.feature.Feature):
            feature = b2.build.feature.get(feature)
        assert isinstance(feature, b2.build.feature.Feature)

        if self.feature_map_ is None:
            self.feature_map_ = {}

            for v in self.all_:
                if v.feature not in self.feature_map_:
                    self.feature_map_[v.feature] = []
                self.feature_map_[v.feature].append(v.value)

        return self.feature_map_.get(feature, [])
538668
public function getFeatureFlagFromKey($featureKey)
    {
        if (isset($this->_featureKeyMap[$featureKey])) {
            return $this->_featureKeyMap[$featureKey];
        }

        $this->_logger->log(Logger::ERROR, sprintf('FeatureFlag Key "%s" is not in datafile.', $featureKey));
        $this->_errorHandler->handleError(new InvalidFeatureFlagException('Provided feature flag is not in datafile.'));
        return new FeatureFlag();
    }
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;
    }