Online status toggle category
774780
public function setToggleVisibilityAction()
    {
        // Check current user authorization
        if (null !== $response = $this->checkAuth($this->resourceCode, array(), AccessManager::UPDATE)) {
            return $response;
        }

        $event = new CategoryToggleVisibilityEvent($this->getExistingObject());

        try {
            $this->dispatch(TheliaEvents::CATEGORY_TOGGLE_VISIBILITY, $event);
        } catch (\Exception $ex) {
            // Any error
            return $this->errorPage($ex);
        }

        // Ajax response -> no action
        return $this->nullResponse();
    }
1040780
def toggle_wrap_mode(self, checked):
        """"""
        self.shell.toggle_wrap_mode(checked)
        self.set_option('wrap', checked)
333449
def toggle(self, section, option):
  """"""
  self.set(section, option, not self.get(section, option))
605023
function(status, text) {

		if(mfp.preloader) {
			if(_prevStatus !== status) {
				mfp.container.removeClass('mfp-s-'+_prevStatus);
			}

			if(!text && status === 'loading') {
				text = mfp.st.tLoading;
			}

			var data = {
				status: status,
				text: text
			};
			// allows to modify status
			_mfpTrigger('UpdateStatus', data);

			status = data.status;
			text = data.text;

			mfp.preloader.html(text);

			mfp.preloader.find('a').on('click', function(e) {
				e.stopImmediatePropagation();
			});

			mfp.container.addClass('mfp-s-'+status);
			_prevStatus = status;
		}
	}
344899
def toggle_wrap_mode(self, checked):
        """"""
        self.plain_text.editor.toggle_wrap_mode(checked)
        self.set_option('wrap', checked)
1087846
def styled_status(enabled, bold=True):
    
    return click.style('Enabled' if enabled else 'Disabled', 'green' if enabled else 'red', bold=bold)
1345376
def toggle_pause(request):
    """"""
    entry = utils.get_active_entry(request.user)
    if not entry:
        raise Http404

    # toggle the paused state
    entry.toggle_paused()
    entry.save()

    # create a message that can be displayed to the user
    action = 'paused' if entry.is_paused else 'resumed'
    message = 'Your entry, {0} on {1}, has been {2}.'.format(
        entry.activity.name, entry.project, action)
    messages.info(request, message)

    # redirect to the log entry list
    return HttpResponseRedirect(reverse('dashboard'))
536663
def toggle_power(self, selector='all', duration=1.0):
        """"""

        argument_tuples = [
            ("duration", duration)
        ]

        return self.client.perform_request(
            method='post', endpoint='lights/{}/toggle',
            endpoint_args=[selector], argument_tuples=argument_tuples)
388555
def _change_kind(self, post_uid):
        '''
        
        '''

        post_data = self.get_post_data()

        logger.info('admin post update: {0}'.format(post_data))

        MPost.update_misc(post_uid, kind=post_data['kcat'])
        # self.update_category(post_uid)

        update_category(post_uid, post_data)
        self.redirect('/{0}/{1}'.format(router_post[post_data['kcat']], post_uid))
501965
def _check_box_toggled(self, widget, data=None):
        
        active = widget.get_active()
        arg_name = data

        if 'entry' in self.args[arg_name]:
            self.args[arg_name]['entry'].set_sensitive(active)
        if 'browse_btn' in self.args[arg_name]:
            self.args[arg_name]['browse_btn'].set_sensitive(active)

        self.path_window.show_all()
461101
function () {
  var cats = getCategories();
  for (var i in cats) {
    log.debug('\n\nTEST CATEGORY: ' + cats[i]);
    testCategory(cats[i]);
  }
}
359092
function setEnabledStateOfLed(callback) {
    var index = 0;
    
    var setEnabledStateOfLedInterval = setInterval(function() {
        if (index <= 5) {
            dothat.barGraph.setEnabledStateOfLed(index, false);
            
            index++;
        } else {
            clearInterval(setEnabledStateOfLedInterval);
            
            if (callback) {
                callback();
            }
        }
    }, 500);
}
293143
def switch_toggle(context, ain):
    """"""
    context.obj.login()
    actor = context.obj.get_actor_by_ain(ain)
    if actor:
        if actor.get_state():
            actor.switch_off()
            click.echo("State for {} is now OFF".format(ain))
        else:
            actor.switch_on()
            click.echo("State for {} is now ON".format(ain))
    else:
        click.echo("Actor not found: {}".format(ain))
414047
def state_category(value):
        """"""
        if value == re.sre_parse.CATEGORY_DIGIT:
            return (yield '0')

        if value == re.sre_parse.CATEGORY_WORD:
            return (yield 'x')
920554
def on_lstCategories_itemSelectionChanged(self):
        
        self.clear_further_steps()
        # Set widgets
        purpose = self.selected_purpose()
        # Exit if no selection
        if not purpose:
            return
        # Set description label
        self.lblDescribeCategory.setText(purpose["description"])
        self.lblIconCategory.setPixmap(QPixmap(
            resources_path('img', 'wizard', 'keyword-category-%s.svg'
                           % (purpose['key'] or 'notset'))))
        # Enable the next button
        self.parent.pbnNext.setEnabled(True)
532572
function() {
      var categoriesDict = {};
      this.device.addCategoriesToDict(categoriesDict);
      this.kernel.addCategoriesToDict(categoriesDict);
      for (var pid in this.processes)
        this.processes[pid].addCategoriesToDict(categoriesDict);

      this.categories = [];
      for (var category in categoriesDict)
        if (category != '')
          this.categories.push(category);
    }
885511
def toggle(self):
        
        with self._lock:
            if self.is_active:
                self.off()
            else:
                self.on()