Will register the {@link ApiFeature} to the list of features providing also the Javascript Script element object
for later removal / update.
766230
public static void register(ApiFeature apiFeature, Callback<Void, Exception> callback) {
        if (apiFeature != null && apiFeature.getApiKey() != null && !apiFeature.getApiKey().isEmpty()) {
            JavaScriptObject scriptObject = ScriptInjector.fromUrl(apiFeature.constructApiUrl())
                    .setWindow(ScriptInjector.TOP_WINDOW)
                    .setCallback(new Callback<Void, Exception>() {
                        @Override
                        public void onFailure(Exception e) {
                            callback.onFailure(e);
                        }

                        @Override
                        public void onSuccess(Void aVoid) {
                            callback.onSuccess(aVoid);
                        }
                    }).inject();
            features.put(apiFeature, scriptObject);
        }
    }
977163
@Setup(Level.Trial)
    public void setupFeatureManager() {
        FeatureManager featureManager = new FeatureManagerBuilder()
                .featureEnums(ScriptEngineActivationStrategyFeatures.class)
                .stateRepository(new InMemoryStateRepository())
                .userProvider(new NoOpUserProvider())
                .build();
        // set up the toggle activation state
        StaticFeatureManagerProvider.setFeatureManager(featureManager);
        manager = featureManager;

        FeatureState alwaysTrueScriptEngineFeatureState = new FeatureState(ScriptEngineActivationStrategyFeatures.ALWAYS_TRUE_SCRIPT_ENGINE_ACTIVATION_STRATEGY);
        alwaysTrueScriptEngineFeatureState.setEnabled(true);
        alwaysTrueScriptEngineFeatureState.setStrategyId(ScriptEngineActivationStrategy.ID);
        alwaysTrueScriptEngineFeatureState.setParameter(ScriptEngineActivationStrategy.PARAM_LANG, "nashorn");
        alwaysTrueScriptEngineFeatureState.setParameter(ScriptEngineActivationStrategy.PARAM_SCRIPT, "true");

        FeatureState dynamicScriptEngineState = new FeatureState(ScriptEngineActivationStrategyFeatures.DYNAMIC_SCRIPT_ENGINE_STRATEGY);
        dynamicScriptEngineState.setEnabled(true);
        dynamicScriptEngineState.setStrategyId(ScriptEngineActivationStrategy.ID);
        dynamicScriptEngineState.setParameter(ScriptEngineActivationStrategy.PARAM_LANG, "nashorn");
        dynamicScriptEngineState.setParameter(ScriptEngineActivationStrategy.PARAM_SCRIPT, "Math.random() < Math.pow(1 - (27 - date.getDate()) * 0.2, 3)");


        manager.setFeatureState(alwaysTrueScriptEngineFeatureState);
        manager.setFeatureState(dynamicScriptEngineState);
    }
640895
@SuppressWarnings("static-method")
	public void getImportedFeatures(List<Class<?>> features) {
		features.add(AtomicIntegerArithmeticExtensions.class);
		features.add(AtomicLongArithmeticExtensions.class);
		features.add(ByteArithmeticExtensions.class);
		features.add(DoubleArithmeticExtensions.class);
		features.add(FloatArithmeticExtensions.class);
		features.add(IntegerArithmeticExtensions.class);
		features.add(LongArithmeticExtensions.class);
		features.add(NumberArithmeticExtensions.class);
		features.add(PrimitiveByteArithmeticExtensions.class);
		features.add(PrimitiveDoubleArithmeticExtensions.class);
		features.add(PrimitiveFloatArithmeticExtensions.class);
		features.add(PrimitiveIntArithmeticExtensions.class);
		features.add(PrimitiveLongArithmeticExtensions.class);
		features.add(PrimitiveShortArithmeticExtensions.class);
		features.add(ShortArithmeticExtensions.class);
	}
79542
public boolean containsFeature(Feature feature) {
		switch (feature) {
			case DRILLDOWN:
				return !getDrilldownOptions().isEmpty();
			case GLOBAL:
				return getGlobal() != null;
			case INTERACTION:
				return !getInteractionFunctions().isEmpty();
			case LIVEDATA:
				return !getLiveDataSeries().isEmpty();
			case SELECTION:
				return !getSelectionFunctions().isEmpty();
			default:
				throw new UnsupportedFeatureException(feature);
		}
	}
619901
public void addFeaturePath( String featurePath, String filter ) {
        if (!featurePaths.contains(featurePath)) {
            featurePaths.add(featurePath);
            if (filter == null) {
                filter = "";
            }
            featureFilter.add(filter);
        }
    }
963985
@VisibleForTesting
  public FeatureSet with(Feature... newFeatures) {
    return new FeatureSet(union(features, ImmutableSet.copyOf(newFeatures)));
  }
744977
def validate_feature_api(project, force=False):
    """"""
    if not force and not project.on_pr():
        raise SkippedValidationTest('Not on PR')

    validator = FeatureApiValidator(project)
    result = validator.validate()
    if not result:
        raise InvalidFeatureApi
244448
public void addFeature(com.ibm.websphere.servlet.container.WebContainer.Feature feature) {
        this.features.add(feature);
    }
719130
public void removeFeature(FeatureInterface<AbstractSequence<C>, C> feature) {
		features.remove(feature);
		ArrayList<FeatureInterface<AbstractSequence<C>, C>> featureList = groupedFeatures.get(feature.getType());
		if (featureList != null) {
			featureList.remove(feature);
			if (featureList.isEmpty()) {
				groupedFeatures.remove(feature.getType());
			}
		}
	}
603776
static void addFeatureToScript(Node scriptNode, Feature feature) {
    checkState(scriptNode.isScript(), scriptNode);
    FeatureSet currentFeatures = getFeatureSetOfScript(scriptNode);
    FeatureSet newFeatures =
        currentFeatures != null
            ? currentFeatures.with(feature)
            : FeatureSet.BARE_MINIMUM.with(feature);
    scriptNode.putProp(Node.FEATURE_SET, newFeatures);
  }
747503
public static String JsonFromFeature(EsriFeature feature) throws JsonGenerationException, JsonMappingException, IOException{
		return jsonObjectMapper.writeValueAsString(feature);
	}
1364830
protected void validateFeatureDictionary() {
    
    FeatureDictionary dict = getFeatureDictionary();
    if (dict != null) {
      if (dict instanceof Iterable<?>) {
        FeatureDictionary posDict = (FeatureDictionary) dict;

        Set<String> dictTags = new HashSet<String>();
        Set<String> poisoned = new HashSet<String>();

        for (WordTag wt : (Iterable<WordTag>) posDict) {
          dictTags.add(wt.getPostag());
        }

        Set<String> modelTags = new HashSet<String>();

        AbstractModel posModel = this.artifactProvider
            .getArtifact(FeaturizerModel.FEATURIZER_MODEL_ENTRY_NAME);
        
        for (int i = 0; i < posModel.getNumOutcomes(); i++) {
          modelTags.add(posModel.getOutcome(i));
        }

        for (String d : dictTags) {
          if (!modelTags.contains(d)) {
            poisoned.add(d);
          }
        }

        this.poisonedDictionaryTags = Collections.unmodifiableSet(poisoned);
        
//        if (poisonedDictionaryTags.size() > 0) {
//          System.err
//              .println("WARNING: Feature dictioinary contains tags which are unkown by the model! "
//                  + this.poisonedDictionaryTags.toString());
//        }
      }
    }
  }
125093
@VisibleForTesting
  public FeatureSet with(FeatureSet newFeatures) {
    return new FeatureSet(union(features, newFeatures.features));
  }
585781
@Api
	public final HandlerRegistration addFeatureSelectionHandler(final FeatureSelectionHandler handler) {
		return handlerManager.addHandler(FeatureSelectionHandler.TYPE, handler);
	}
607359
public function addFeature(ScriptFeature $feature)
    {
        if (!in_array($feature, $this->features, true)) {
            array_push($this->features, $feature);
        }
        return $this;
    }
319936
public void setFeatures(Map<String, List<org.geomajas.layer.feature.Feature>> featureMap) {
		MapModel mapModel = mapWidget.getMapModel();

		for (Entry<String, List<org.geomajas.layer.feature.Feature>> clientLayerId : featureMap.entrySet()) {
			Layer<?> layer = mapModel.getLayer(clientLayerId.getKey());
			if (null != layer) {
				List<org.geomajas.layer.feature.Feature> orgFeatures = clientLayerId.getValue();
				if (!orgFeatures.isEmpty()) {
					addFeatures(layer, orgFeatures);
				}
			}
		}
	}
875072
function _fnFeatureHtmlProcessing ( oSettings )
		{
			var nProcessing = document.createElement( 'div' );
			
			if ( !oSettings.aanFeatures.r )
			{
				nProcessing.id = oSettings.sTableId+'_processing';
			}
			nProcessing.innerHTML = oSettings.oLanguage.sProcessing;
			nProcessing.className = oSettings.oClasses.sProcessing;
			oSettings.nTable.parentNode.insertBefore( nProcessing, oSettings.nTable );
			
			return nProcessing;
		}