Public: Returns state for feature (:on, :off, or :conditional).
483735
def state
      values = gate_values
      boolean = gate(:boolean)
      non_boolean_gates = gates - [boolean]

      if values.boolean || values.percentage_of_actors == 100 || values.percentage_of_time == 100
        :on
      elsif non_boolean_gates.detect { |gate| gate.enabled?(values[gate.key]) }
        :conditional
      else
        :off
      end
    end
1187266
private static boolean isAnnotated(Feature feature)
    {
        for (final Class<?> current : feature.getClass().getInterfaces())
        {
            if (current.isAnnotationPresent(FeatureInterface.class))
            {
                return true;
            }
        }
        return feature.getClass().isAnnotationPresent(FeatureInterface.class);
    }
1050925
@Setup(Level.Iteration)
    public void toggleEnabledState() {
        enabled = !enabled;
        manager.setFeatureState(new FeatureState(OverheadFeature.FEATURE, enabled));
    }
851444
def get_spot(self, feature=None, **kwargs):
        
        kwargs.setdefault('kind', 'spot')
        return self.get_feature(feature, **kwargs)
149578
function (ele, state) {
            if (typeof state === 'boolean') {
                return state ? this.show() : this.hide();
            }

            if (isHidden(ele)) {
                showHide(ele, true);
            } else {
                showHide(ele);
            }
            return this;
        }
981457
def popState(self):
        
        diff = self._states.pop() - len(self)
        if diff:
            self.extend(self._hidden[-diff:])
            del self._hidden[-diff:]
1189009
def >>(*args)
      args.to_a.flatten.each do |feature|
        features.delete feature.to_sym
      end
      self
    end
495336
def _get_state(inspect_results):
    '''
    
    '''
    if inspect_results.get('State', {}).get('Paused', False):
        return 'paused'
    elif inspect_results.get('State', {}).get('Running', False):
        return 'running'
    else:
        return 'stopped'
71614
def switch_off(self):
        """"""
        success = self.set_status(CONST.STATUS_OFF_INT)

        if success:
            self._json_state['status'] = CONST.STATUS_OFF

        return success
569492
def toggle_state(state)
      @states.select { |s, _| s == state }.each do |s, v|
        v[1] = !v[1]
        classify_state v
      end
    end
953535
def check(self, feature):
        
        try:
            buf = io.BytesIO()
            pickle.dump(feature, buf, protocol=pickle.HIGHEST_PROTOCOL)
            buf.seek(0)
            new_feature = pickle.load(buf)
            assert new_feature is not None
            assert isinstance(new_feature, Feature)
        finally:
            buf.close()
86668
def toggle_state(self, state, active=TOGGLE, scope=None):
        
        self.conversation(scope).toggle_state(state, active)
1112435
def is_active(feature):
  

  if current_app:
    feature_flagger = current_app.extensions.get(EXTENSION_NAME)
    if feature_flagger:
      return feature_flagger.check(feature)
    else:
      raise AssertionError("Oops. This application doesn't have the Flask-FeatureFlag extention installed.")

  else:
    log.warn(u"Got a request to check for {feature} but we're running outside the request context. Check your setup. Returning False".format(feature=feature))
    return False
1240608
def _check_state(self):
        
        if(self.grid is not None and
           self.configs.configs is not None and
           self.assignments['forward_model'] is not None):
            self.can_model = True

        if(self.grid is not None and
           self.assignments['measurements'] is not None):
            self.can_invert = True
356747
def get_state(self):
        """"""
        return {"started": (True if self.background_process and
                            self.background_process.is_alive() else False),
                "paused": self._pause.value,
                "stopped": self._end.value,
                "tasks": len(self.current_tasks),
                "busy_tasks": len(self.busy_tasks),
                "free_tasks": len(self.free_tasks)}
938579
def switch_on(self):
        """"""
        success = self.set_status(CONST.STATUS_OPEN_INT)

        if success:
            self._json_state['status'] = CONST.STATUS_OPEN

        return success
183938
def _prepare_transition(self, is_on=None, **kwargs):
        
        # Handle transitions with changing on-off-state
        dest_state = kwargs.copy()
        if is_on is not None:
            if is_on and not self.is_on:
                if 'brightness' not in kwargs or kwargs['brightness'] is None:
                    dest_state['brightness'] = self.brightness
                self.set(brightness=0, cancel_transition=False)
            elif not is_on and self.is_on:
                dest_state['brightness'] = 0

        return dest_state