enable slow wave and spindle detection if both
        annotations and channels are active.
344677
def enable_events(self):
        
        if self.annot is not None and self.parent.channels.groups:
            self.action['spindle'].setEnabled(True)
            self.action['slow_wave'].setEnabled(True)
            self.action['analyze'].setEnabled(True)
        else:
            self.action['spindle'].setEnabled(False)
            self.action['slow_wave'].setEnabled(False)
            self.action['analyze'].setEnabled(False)
78851
def turn_on(options = {})
      _check_server!
      return unless enabled?

      fail "Already active!" if active?

      _turn_on_notifiers(options)
      _env.notify_active = true
    end
230991
def add_synchronous_cb(self, cb):
        '''
        
        '''
        if self.connection.synchronous or self._synchronous:
            wrapper = SyncWrapper(cb)
            self._pending_events.append(wrapper)
            while wrapper._read:
                # Don't check that the channel has been closed until after
                # reading frames, in the case that this is processing a clean
                # channel closed. If there's a protocol error during
                # read_frames, this will loop back around and result in a
                # channel closed exception.
                if self.closed:
                    if self.close_info and \
                            len(self.close_info['reply_text']) > 0:
                        raise ChannelClosed(
                            "channel %d is closed: %s : %s",
                            self.channel_id,
                            self.close_info['reply_code'],
                            self.close_info['reply_text'])
                    raise ChannelClosed()
                self.connection.read_frames()

            return wrapper._result
        else:
            self._pending_events.append(cb)
254526
def is_on(self, channel):
        
        if channel in self._is_on:
            return self._is_on[channel]
        return False
768575
def _connect_signals():
    """"""
    for index in settings.get_index_names():
        for model in settings.get_index_models(index):
            _connect_model_signals(model)
61986
def watch_activations(self, flag):
        """"""
        lib.EnvSetDefruleWatchActivations(self._env, int(flag), self._rule)
939394
protected void triggerEpochListeners(boolean epochStart, Model model, int epochNum){
        Collection<TrainingListener> listeners;
        if(model instanceof MultiLayerNetwork){
            MultiLayerNetwork n = ((MultiLayerNetwork) model);
            listeners = n.getListeners();
            n.setEpochCount(epochNum);
        } else if(model instanceof ComputationGraph){
            ComputationGraph cg = ((ComputationGraph) model);
            listeners = cg.getListeners();
            cg.getConfiguration().setEpochCount(epochNum);
        } else {
            return;
        }

        if(listeners != null && !listeners.isEmpty()){
            for (TrainingListener l : listeners) {
                if (epochStart) {
                    l.onEpochStart(model);
                } else {
                    l.onEpochEnd(model);
                }
            }
        }
    }
1011869
private void setActiveGUI( final boolean isEnabled ) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				toolbar.setEnabled(isEnabled);
				for( JComboBox b : algBoxes ) {
					b.setEnabled(isEnabled);
				}
				for( JComponent b : addedComponents ) {
					b.setEnabled(isEnabled);
				}
				imageBox.setEnabled(isEnabled);
			}
		});
	}
839502
private void signalNoConnections() {
        EventEngine events = HttpDispatcher.getEventService();
        if (null == events) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                Tr.event(tc, "Unable to send event, missing service");
            }
            return;
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
            Tr.event(tc, "No active connections, sending stop chain event");
        }
        Event event = events.createEvent(ChannelFramework.EVENT_STOPCHAIN);
        event.setProperty(ChannelFramework.EVENT_CHANNELNAME, this.chfwConfig.getExternalName());
        events.postEvent(event);
    }
275930
public synchronized void enableGestureDetector() {
        final GVRTouchPadGestureListener gestureListener = new GVRTouchPadGestureListener() {
            @Override
            public boolean onSwipe(MotionEvent e, Action action, float vx, float vy) {
                if (null != mGVRMain) {
                    mGVRMain.onSwipe(action, vx);
                }
                return true;
            }

            @Override
            public boolean onSingleTapUp(MotionEvent e) {
                if (null != mGVRMain) {
                    mGVRMain.onSingleTapUp(e);
                }
                return true;
            }
        };
        mGestureDetector = new GestureDetector(mActivity.getApplicationContext(), gestureListener);
        getEventReceiver().addListener(new GVREventListeners.ActivityEvents() {
            @Override
            public void dispatchTouchEvent(MotionEvent event) {
                mGestureDetector.onTouchEvent(event);
            }
        });
    }
506801
def listen(self, markAlive=None):
        
        if markAlive is not None:
            self.setActiveStatus(markAlive)

        self.startListening()
        self.onListening()

        while self.listening and self.doOneListen():
            pass

        self.stopListening()
1347925
function(id) {
            if (!Crafty.support.audio) return;
            var c;
            for (var i in this.channels) {
                c = this.channels[i];
                if ((!id && c.active) || c._is(id)) {
                    c.active = false;
                    c.obj.pause();
                }
            }
            return;
        }
994754
private void detectIntegratorTemplateModes() {
    // integrator mode cannot be active if no modes defined
    if (urlHandlerConfig.getIntegratorModes().isEmpty()) {
      return;
    }
    if (request != null && RequestPath.hasSelector(request, SELECTOR_INTEGRATORTEMPLATE_SECURE)) {
      integratorTemplateSecureMode = true;
    }
    else if (request != null && RequestPath.hasSelector(request, SELECTOR_INTEGRATORTEMPLATE)) {
      integratorTemplateMode = true;
    }
  }
977154
def set_active_current(self, axis, amp):
        
        self._smoothie_driver.set_active_current({axis.name: amp})
221282
def _set_motion_detection(self, enable):
        """"""
        url = ('%s/ISAPI/System/Video/inputs/'
               'channels/1/motionDetection') % self.root_url

        enabled = self._motion_detection_xml.find(self.element_query('enabled'))
        if enabled is None:
            _LOGGING.error("Couldn't find 'enabled' in the xml")
            _LOGGING.error('XML: %s', ET.tostring(self._motion_detection_xml))
            return

        enabled.text = 'true' if enable else 'false'
        xml = ET.tostring(self._motion_detection_xml)

        try:
            response = self.hik_request.put(url, data=xml, timeout=CONNECT_TIMEOUT)
        except (requests.exceptions.RequestException,
                requests.exceptions.ConnectionError) as err:
            _LOGGING.error('Unable to set MotionDetection, error: %s', err)
            return

        if response.status_code == requests.codes.unauthorized:
            _LOGGING.error('Authentication failed')
            return

        if response.status_code != requests.codes.ok:
            # If we didn't receive 200, abort
            _LOGGING.error('Unable to set motion detection: %s', response.text)

        self.motion_detection = enable
14386
private void channelActiveSideEffects(final ChannelHandlerContext ctx) {
        long interval = env().keepAliveInterval();
        if (env().continuousKeepAliveEnabled()) {
            continuousKeepAliveFuture = ctx.executor().scheduleAtFixedRate(new Runnable() {
                @Override
                public void run() {
                    if (shouldSendKeepAlive()) {
                        createAndWriteKeepAlive(ctx);
                    }
                }
            }, interval, interval, TimeUnit.MILLISECONDS);
        }
    }
529787
final static void enable() {
		if (lifeCycle.getStatus().equals(RunStatus.READY) || lifeCycle.getStatus().equals(RunStatus.STOPPED)) {
			init();
		} else if (lifeCycle.getStatus().equals(RunStatus.DISABLED)) {
			lifeCycle.setStatus(RunStatus.RUNNING);
		}
	}