Clean method that will be executed after each feature

    :param context: behave context
    :param feature: running feature
17108
def after_feature(context, feature):
    
    # Behave dynamic environment
    context.dyn_env.execute_after_feature_steps(context)

    # Close drivers
    DriverWrappersPool.close_drivers(scope='module', test_name=feature.name,
                                     test_passed=context.global_status['test_passed'])
1066955
def clear_all(self):
        """"""
        logger.info("Clearing ALL Features and FeatureKeys.")
        self.session.query(Feature).delete(synchronize_session="fetch")
        self.session.query(FeatureKey).delete(synchronize_session="fetch")
1232581
public boolean performTracking(  PyramidKltFeature feature ) {

		KltTrackFault result = tracker.track(feature);

		if( result != KltTrackFault.SUCCESS ) {
			return false;
		} else {
			tracker.setDescription(feature);
			return true;
		}
	}
1151060
def execute(self, context):
        """"""
        for ware in self.middleware:
            ware.premessage(context)
            context = ware.bind(context)
            ware.postmessage(context)
        return context
351172
def onWith(self, evnt, func):
        '''
        
        '''
        self.on(evnt, func)
        # Allow exceptions to propagate during the context manager
        # but ensure we cleanup our temporary callback
        try:
            yield self
        finally:
            self.off(evnt, func)
1239408
def run(*extractor_list, **kwargs):
    """"""
    args = _get_args(kwargs.get('args'))
    n_extractors = len(extractor_list)
    log.info('Going to run list of {} FeatureExtractors'.format(n_extractors))
    collection = fex.Collection(cache_path=args.cache_path)
    for extractor in extractor_list:
        collection.add_feature_extractor(extractor)

    out_path = args.path
    if args.deploy:
        out_path = _prefix_git_hash(out_path)
    collection.run(out_path)
753399
def after(self, context):
        ""
        self._invoke(self._after, context)
        run.after_each.execute(context)
1154088
def execute(self, eopatch):
        
        # pylint: disable=too-many-locals
        feature_type, feature_name, new_feature_name = next(self.feature(eopatch))

        # Make a copy not to change original numpy array
        feature_data = eopatch[feature_type][feature_name].copy()
        time_num, height, width, band_num = feature_data.shape
        if time_num <= 1:
            raise ValueError('Feature {} has time dimension of size {}, required at least size '
                             '2'.format((feature_type, feature_name), time_num))

        # Apply a mask on data
        if self.mask_feature is not None:
            for mask_type, mask_name in self.mask_feature(eopatch):
                negated_mask = ~eopatch[mask_type][mask_name].astype(np.bool)
                feature_data = self._mask_feature_data(feature_data, negated_mask, mask_type)

        # Flatten array
        feature_data = np.reshape(feature_data, (time_num, height * width * band_num))

        # If resampling create new EOPatch
        new_eopatch = EOPatch() if self.resample_range else eopatch

        # Resample times
        times = eopatch.time_series(scale_time=self.scale_time)
        new_eopatch.timestamp = self.get_resampled_timestamp(eopatch.timestamp)
        total_diff = int((new_eopatch.timestamp[0].date() - eopatch.timestamp[0].date()).total_seconds())
        resampled_times = new_eopatch.time_series(scale_time=self.scale_time) + total_diff // self.scale_time

        # Add BBox to eopatch if it was created anew
        if new_eopatch.bbox is None:
            new_eopatch.bbox = eopatch.bbox

        # Replace duplicate acquisitions which have same values on the chosen time scale with their average
        feature_data, times = self._get_unique_times(feature_data, times)

        # Interpolate
        feature_data = self.interpolate_data(feature_data, times, resampled_times)

        # Normalize
        if self.result_interval:
            min_val, max_val = self.result_interval
            valid_mask = ~np.isnan(feature_data)
            feature_data[valid_mask] = np.maximum(np.minimum(feature_data[valid_mask], max_val), min_val)

        # Replace unknown value
        if not np.isnan(self.unknown_value):
            feature_data[np.isnan(feature_data)] = self.unknown_value

        # Reshape back
        new_eopatch[feature_type][new_feature_name] = np.reshape(feature_data,
                                                                 (feature_data.shape[0], height, width, band_num))

        # append features from old patch
        new_eopatch = self._copy_old_features(new_eopatch, eopatch, self.copy_features)

        return new_eopatch
858083
function runGetFeature(callback) {
  var next = _.after(2, callback);
  function featureCallback(error, feature) {
    if (error) {
      callback(error);
      return;
    }
    if (feature.name === '') {
      console.log('Found no feature at ' +
          feature.location.latitude/COORD_FACTOR + ', ' +
          feature.location.longitude/COORD_FACTOR);
    } else {
      console.log('Found feature called "' + feature.name + '" at ' +
          feature.location.latitude/COORD_FACTOR + ', ' +
          feature.location.longitude/COORD_FACTOR);
    }
    next();
  }
  var point1 = {
    latitude: 409146138,
    longitude: -746188906
  };
  var point2 = {
    latitude: 0,
    longitude: 0
  };
  client.getFeature(point1, featureCallback);
  client.getFeature(point2, featureCallback);
}
1257153
def before_scenario(context, scenario):
    
    # Configure reset properties from behave tags
    if 'no_reset_app' in scenario.tags:
        os.environ["AppiumCapabilities_noReset"] = 'true'
        os.environ["AppiumCapabilities_fullReset"] = 'false'
    elif 'reset_app' in scenario.tags:
        os.environ["AppiumCapabilities_noReset"] = 'false'
        os.environ["AppiumCapabilities_fullReset"] = 'false'
    elif 'full_reset_app' in scenario.tags:
        os.environ["AppiumCapabilities_noReset"] = 'false'
        os.environ["AppiumCapabilities_fullReset"] = 'true'

    # Force to reset driver before each scenario if it has @reset_driver tag
    if 'reset_driver' in scenario.tags:
        DriverWrappersPool.stop_drivers()
        DriverWrappersPool.download_videos('multiple tests', context.global_status['test_passed'])
        DriverWrappersPool.save_all_ggr_logs('multiple tests', context.global_status['test_passed'])
        DriverWrappersPool.remove_drivers()
        context.global_status['test_passed'] = True

    # Skip android_only or ios_only scenarios
    if 'android_only' in scenario.tags and context.driver_wrapper.is_ios_test():
        scenario.skip('Android scenario')
        return
    elif 'ios_only' in scenario.tags and context.driver_wrapper.is_android_test():
        scenario.skip('iOS scenario')
        return

    # Read @no_driver tag
    no_driver = 'no_driver' in scenario.tags or 'no_driver' in scenario.feature.tags

    bdd_common_before_scenario(context, scenario, no_driver)

    # Behave dynamic environment
    context.dyn_env.execute_before_scenario_steps(context)
82879
def clear_context(self, app=None):
        
        if (app is None and self._context is _CONTEXT_MISSING
                and not in_app_context()):
            raise RuntimeError("Attempted to clear component context without"
                               " a bound app context or eager app set! Please"
                               " pass the related app you want to update the"
                               " context for!")

        if self._context is not _CONTEXT_MISSING:
            self._context = DEFAULT_DICT
        else:
            key = self._get_context_name(app=app)
            setattr(_CONTEXT_LOCALS, key, DEFAULT_DICT)
156365
def before_feature(context, feature):
    
    context.global_status = {'test_passed': True}

    # Read @no_driver tag
    no_driver = 'no_driver' in feature.tags

    # Start driver if it should be reused in feature
    context.reuse_driver_from_tags = 'reuse_driver' in feature.tags
    if context.toolium_config.getboolean_optional('Driver', 'reuse_driver') or context.reuse_driver_from_tags:
        start_driver(context, no_driver)

    # Behave dynamic environment
    context.dyn_env.get_steps_from_feature_description(feature.description)
    context.dyn_env.execute_before_feature_steps(context)
110996
def removeFeatureSet(self, featureSet):
        
        q = models.Featureset.delete().where(
            models.Featureset.id == featureSet.getId())
        q.execute()
180252
def _finalize_features(self):
        """"""

        # First, flag all the enabled items (and thus their dependencies)
        for name, feature in self.features.items():
            enabled = self.feature_is_included(name)
            if enabled or (enabled is None and feature.include_by_default()):
                feature.include_in(self)
                self._set_feature(name, 1)

        # Then disable the rest, so that off-by-default features don't
        # get flagged as errors when they're required by an enabled feature
        for name, feature in self.features.items():
            if not self.feature_is_included(name):
                feature.exclude_from(self)
                self._set_feature(name, 0)
141513
protected void invokeFeature(String featureSwitch, Feature feature ) {
        if(Config.getBooleanProperty(featureSwitch,true)) {
            feature.execute();
        }
    }
677519
def execute_after_scenario_steps(self, context):
        
        if not self.feature_error and not self.scenario_error:
            self.__execute_steps_by_action(context, ACTIONS_AFTER_SCENARIO)

        # Behave dynamic environment: Fail all steps if dyn_env has got any error and reset it
        if self.reset_error_status():
            context.scenario.reset()
            context.dyn_env.fail_first_step_precondition_exception(context.scenario)
171
public void run(Context context) throws IOException, InterruptedException {
    setup(context);
    while (context.nextKeyValue()) {
      map(context.getCurrentKey(), context.getCurrentValue(), context);
    }
    cleanup(context);
  }