Toggles the dataset based on the given action or dataset.
        
        :param      state | <bool>
                    dataset | <XChartDataset>
481621
def toggleDataset(self, state, dataset=None):
        
        if dataset is None and self.sender():
            dataset = unwrapVariant(self.sender().data())
        
        dataset.setVisible(state)
        self._dataChanged = True
        self.recalculate()
999950
private void setState(State state) {
    if (this.state != state) {
      this.state = state;
      log.debug("State changed: {}", state);
    }
  }
569492
def toggle_state(state)
      @states.select { |s, _| s == state }.each do |s, v|
        v[1] = !v[1]
        classify_state v
      end
    end
1077995
private boolean setState(State newState) {
        switch (newState) {
            case DEPLOYED:
                return changeState(State.DEPLOYING, State.DEPLOYED);
            case DEPLOYING:
                //can move from either UNDEPLOYED or FAILED into DEPLOYING state
                return (changeState(State.UNDEPLOYED, State.DEPLOYING) || changeState(State.FAILED, State.DEPLOYING));
            case UNDEPLOYING:
                return changeState(State.DEPLOYED, State.UNDEPLOYING);
            case UNDEPLOYED:
                return changeState(State.UNDEPLOYING, State.UNDEPLOYED);
            case FAILED:
                return changeState(State.DEPLOYING, State.FAILED);
            default:
                return false;
        }
    }
920183
def change_bgcolor_enable(self, state):
        
        self.dataModel.bgcolor(state)
        self.bgcolor_global.setEnabled(not self.is_series and state > 0)
299542
public void setDataSet(PagedDataSet dataSet) {
        /* todo: would be nice to address this side-effect outside of the setter */
        _dataSet = dataSet;
        _dataGridState.getPagerModel().setDataSetSize(_dataSet.getSize());
    }
672354
def set_checked(self, state):
        

        if not self.__checkable:
            return False

        if state:
            self.__checked = True
            self.setPixmap(self.__active_pixmap)
        else:
            self.__checked = False
            self.setPixmap(self.__default_pixmap)
        self.toggled.emit(state)
        return True
323232
public static void assertState(String message, DataSet dataSet) throws DBAssertionError {
    DBAssert.stateAssertion(CallInfo.create(message), dataSet);
  }
795458
def set_show_all(self, state):
        """"""
        if state:
            self.fsmodel.setNameFilters([])
        else:
            self.fsmodel.setNameFilters(self.name_filters)
718898
protected void onDataSetStaleEvent(@Observes DataSetStaleEvent event) {
        DataSetDef def = event.getDataSetDef();
        if (DataSetProviderType.BEAN.equals(def.getProvider())) {
            staticDataSetProvider.removeDataSet(def.getUUID());
        }
    }
1272357
def toggle_axis(self):
        
        # cycle through three axis states
        states = [False, 'world', 'all']
        # the state after toggling
        index = (states.index(self.view['axis']) + 1) % len(states)
        # update state to next index
        self.view['axis'] = states[index]
        # perform gl actions
        self.update_flags()
297265
def set_state(self, newState, timer=0):
        """"""
        if _debug: SSM._debug("set_state %r (%s) timer=%r", newState, SSM.transactionLabels[newState], timer)

        # make sure we have a correct transition
        if (self.state == COMPLETED) or (self.state == ABORTED):
            e = RuntimeError("invalid state transition from %s to %s" % (SSM.transactionLabels[self.state], SSM.transactionLabels[newState]))
            SSM._exception(e)
            raise e

        # stop any current timer
        self.stop_timer()

        # make the change
        self.state = newState

        # if another timer should be started, start it
        if timer:
            self.start_timer(timer)
702190
def setDatastreamState(self, pid, dsID, dsState):
        '''
        '''
        # /objects/{pid}/datastreams/{dsID} ? [dsState]
        http_args = {'dsState' : dsState}
        url = 'objects/%(pid)s/datastreams/%(dsid)s' % {'pid': pid, 'dsid': dsID}
        response = self.put(url, params=http_args)
        # returns response code 200 on success
        return response.status_code == requests.codes.ok
554890
def updateData(self, state_data, action_data, reward_data):
        
#        self.dataLock.acquire()

        self.state_data[:, self.updates] = state_data
        self.action_data[:, self.updates] = action_data
        self.reward_data[0, self.updates] = reward_data
        self.updates += 1
        self._render()
281097
def setShowGridRows( self, state ):
        
        delegate = self.itemDelegate()
        if ( isinstance(delegate, XTreeWidgetDelegate) ):
            delegate.setShowGridRows(state)
199580
private void persistDatasetState(String datasetUrn, JobState.DatasetState datasetState)
      throws IOException {
    log.info("Persisting dataset state for dataset " + datasetUrn);
    this.jobContext.getDatasetStateStore().persistDatasetState(datasetUrn, datasetState);
  }
441437
function toggle(pos, state, ruleId) {
      var markers = ruleId ? scope[ruleId] : globals
      var currentState
      var previousState

      if (!markers) {
        markers = []
        scope[ruleId] = markers
      }

      previousState = getState(ruleId)
      currentState = state

      if (currentState !== previousState) {
        markers.push({state: currentState, position: pos})
      }

      /* Toggle all known rules. */
      if (!ruleId) {
        for (ruleId in scope) {
          toggle(pos, state, ruleId)
        }
      }
    }