Called when an Event is received on the decisions channel. Saves
        the value in group_decisions. If num_subperiods is None, immediately
        broadcasts the event back out on the group_decisions channel.
762741
def _on_decisions_event(self, event=None, **kwargs):
        
        if not self.ran_ready_function:
            logger.warning('ignoring decision from {} before when_all_players_ready: {}'.format(event.participant.code, event.value))
            return
        with track('_on_decisions_event'):
            self.group_decisions[event.participant.code] = event.value
            self._group_decisions_updated = True
            self.save(update_fields=['group_decisions', '_group_decisions_updated'])
            if not self.num_subperiods() and not self.rate_limit():
                self.send('group_decisions', self.group_decisions)
760648
def save(self, *args, **kwargs):
        
        if self.publish_date is None:
            self.publish_date = now()
        super(Displayable, self).save(*args, **kwargs)
543542
def on_update(self, value, *args, **kwargs):
        
        parent_value = self._parent_min
        if self._max != self._min:
            sub_progress = (value - self._min) / (self._max - self._min)
            parent_value = self._parent_min + sub_progress * (self._parent_max - self._parent_min)
        self._parent.update(parent_value, *args, **kwargs)
195202
def set(self, value: Optional[bool]):
        
        prev_value = self._value
        self._value = value
        if self._value != prev_value:
            # notify all watchers that this check was changed
            for event in self._events:
                event.set()
341987
def _on_select(self, *args):
        
        if callable(self.__callback):
            self.__callback(self.selection)
350369
def _on_group_stream_changed(self, data):
        """"""
        self._groups.get(data.get('id')).update_stream(data)
171001
function choiceListener(index) {
  return function (event) {
    event.preventDefault();
    if (choicesAnimating) return;
    clearChoiceListeners();
    story.ChooseChoiceIndex(index);
    saveGame(index);
    clearOldChoices().then(() => progressGame());
  }
}
1144414
def save(self, *args, **kwargs):
        '''
        
        '''
        # Set the approval and payment dates if they have just been approved/paid.
        if not hasattr(self,'__paid') or not hasattr(self,'__approved'):
            if self.approved and not self.approvalDate:
                self.approvalDate = timezone.now()
            if self.paid and not self.paymentDate:
                self.paymentDate = timezone.now()
        else:
            if self.approved and not self.approvalDate and not self.__approvalDate:
                self.approvalDate = timezone.now()
            if self.paid and not self.paymentDate and not self.__paymentDate:
                self.paymentDate = timezone.now()

        # Fill out the series and event properties to permit easy calculation of
        # revenues and expenses by series or by event.
        if self.expenseRule and not self.payTo:
            this_loc = getattr(self.expenseRule,'location',None)
            this_member = getattr(self.expenseRule,'location',None)

            if this_loc:
                self.payTo = TransactionParty.objects.get_or_create(
                    location=this_loc,
                    defaults={'name': this_loc.name}
                )[0]
            elif this_member:
                self.payTo = TransactionParty.objects.get_or_create(
                    staffMember=this_member,
                    defaults={
                        'name': this_member.fullName,
                        'user': getattr(this_member,'userAccount',None)
                    }
                )[0]

        # Set the accrual date.  The method for events ensures that the accrualDate month
        # is the same as the reported month of the series/event by accruing to the end date of the last
        # class or occurrence in that month.
        if not self.accrualDate:
            if self.event and self.event.month:
                self.accrualDate = self.event.eventoccurrence_set.order_by('endTime').filter(**{'endTime__month': self.event.month}).last().endTime
            elif self.submissionDate:
                self.accrualDate = self.submissionDate
            else:
                self.submissionDate = timezone.now()
                self.accrualDate = self.submissionDate

        # Set the total for hourly work
        if self.hours and not self.wageRate and not self.total and not getattr(getattr(self,'payTo',None),'location',None) and self.category:
            self.wageRate = self.category.defaultRate
        elif self.hours and not self.wageRate and not self.total and getattr(getattr(self,'payTo',None),'location',None):
            self.wageRate = self.payTo.location.rentalRate

        if self.hours and self.wageRate and not self.total:
            self.total = self.hours * self.wageRate

        super(ExpenseItem, self).save(*args, **kwargs)
        self.__approved = self.approved
        self.__paid = self.paid
        self.__approvalDate = self.approvalDate
        self.__paymentDate = self.paymentDate

        # If a file is attached, ensure that it is not public, and that it is saved in the 'Expense Receipts' folder
        if self.attachment:
            try:
                self.attachment.folder = Folder.objects.get(name=_('Expense Receipts'))
            except ObjectDoesNotExist:
                pass
            self.attachment.is_public = False
            self.attachment.save()
781595
public void signalGroup(Signal signal, int groupNum) {

        CmsPublishGroup group = m_groups.get(groupNum);
        for (CmsPublishResource res : group.getResources()) {
            CmsUUID id = res.getId();
            m_status.get(id).handleSignal(signal);
        }
        runSelectionChangeAction();
    }
1253489
def _subscribed_event_count(self) -> int:
        
        event_counter = Counter()  # type: Dict[Any, int]

        for key, values in self._events.items():
            event_counter[key] = len(values)

        return sum(event_counter.values())
333792
function(channel, subscription, context, once) {
      if (!channels[channel]) channels[channel] = [];
      channels[channel].push({fn: subscription, context: context || this, once: once});
    }
589869
@Handler(priority = 1000)
    public void onProtocolSwitchAccepted(
            ProtocolSwitchAccepted event, IOSubchannel channel) {
        event.requestEvent().associated(Session.class)
            .ifPresent(session -> {
                channel.setAssociated(Session.class, session);
            });
    }
537674
function onSubmit() {
					oRequestLock = that.oRequestor.getModelInterface()
						.lockGroup(sGroupId, true, that);
					if (fnPatchSent) {
						fnPatchSent();
					}
				}
184053
function limitNotifySubscribers(value, event) {
    if (!event || event === defaultEvent) {
        this._limitChange(value);
    } else if (event === 'beforeChange') {
        this._limitBeforeChange(value);
    } else {
        this._origNotifySubscribers(value, event);
    }
}
1284703
@Override
    protected boolean reSubscribe(EventChannelStruct channelStruct, EventCallBackStruct eventCallBackStruct) {
        //  ToDo
        boolean done = false;
        try {
            ApiUtil.printTrace("====================================================\n" +
                                "   Try to resubscribe " + eventCallBackStruct.channel_name);
            DevVarLongStringArray   lsa =
                ZMQutils.getEventSubscriptionInfoFromAdmDevice(
                        channelStruct.adm_device_proxy,
                        eventCallBackStruct.device.name(),
                        eventCallBackStruct.attr_name, eventCallBackStruct.event_name);

            //  Update the heartbeat time
            String  admDeviceName = channelStruct.adm_device_proxy.name();  //.toLowerCase();
            //  Since Tango 8.1, heartbeat is sent in lower case.
            if (channelStruct.getTangoRelease()>=810)
                admDeviceName = admDeviceName.toLowerCase();
            push_structured_event_heartbeat(admDeviceName);
            channelStruct.heartbeat_skipped = false;
            channelStruct.last_subscribed = System.currentTimeMillis();
            channelStruct.setTangoRelease(lsa.lvalue[0]);
            channelStruct.setIdlVersion(lsa.lvalue[1]);
            eventCallBackStruct.last_subscribed = channelStruct.last_subscribed;
            done = true;
        }
        catch(DevFailed e) {
            /* */
        }
        return done;
    }
1014960
def control_change(self, channel, control, value):
        
        if control < 0 or control > 128:
            return False
        if value < 0 or value > 128:
            return False
        self.cc_event(channel, control, value)
        self.notify_listeners(self.MSG_CC, {'channel': int(channel),
            'control': int(control), 'value': int(value)})
        return True
541222
public void InvokeEvent(String eventName, JSONArray args)
    {
        HubOnDataCallback subscription;
        if(mSubscriptions.containsKey(eventName))
        {
        	subscription = mSubscriptions.get(eventName);
            subscription.OnReceived(args);
        }
    }