intercepts changes to is_published and fires layer_is_published_changed signal
321318
def save(self, *args, **kwargs):
        
        super(Layer, self).save(*args, **kwargs)

        # if is_published of an existing layer changes
        if self.pk and self.is_published != self._current_is_published:
            # send django signal
            layer_is_published_changed.send(
                sender=self.__class__,
                instance=self,
                old_is_published=self._current_is_published,
                new_is_published=self.is_published
            )
            # unpublish nodes
            self.update_nodes_published()

        # update _current_is_published
        self._current_is_published = self.is_published
720156
def emit_data_changed(self):
        
        item = self.get_treeitem()
        m = item.get_model()
        if m:
            start = m.index_of_item(item)
            parent = start.parent()
            end = m.index(start.row(), item.column_count()-1, parent)
            m.dataChanged.emit(start, end)
406325
@Override
    public void notifyLayerChanged(FeatureProvider provider,
                                   Integer layerRefreshOld,
                                   Integer layerRefreshNew,
                                   Integer layerDisplayOld,
                                   Integer layerDisplayNew)
    {
        if (provider.hasFeature(Displayable.class))
        {
            final Displayable displayable = provider.getFeature(Displayable.class);
            getLayer(layerDisplayOld).remove(displayable);
            getLayer(layerDisplayNew).add(displayable);
            indexs.add(layerDisplayNew);
        }
    }
522047
function _triggerLayerEvent($canvas, data, layer, eventType, arg) {
	// If layer can legally fire this event type
	if (_layerCanFireEvent(layer, eventType)) {

		// Do not set a custom cursor on layer mouseout
		if (eventType !== 'mouseout') {
			// Update cursor if one is defined for this event
			_setCursor($canvas, layer, eventType);
		}

		// Trigger the user-defined event callback
		_runEventCallback($canvas, layer, eventType, layer, arg);
		// Trigger the canvas-bound event hook
		_runEventCallback($canvas, layer, eventType, data.eventHooks, arg);
		// Trigger the global event hook
		_runEventCallback($canvas, layer, eventType, jCanvas.eventHooks, arg);

	}
}
788187
def get_published(self, layer_id, expand=[]):
        
        target_url = self.client.get_url('VERSION', 'GET', 'published', {'layer_id': layer_id})
        return self._get(target_url, expand=expand)
1156439
function(event, path) {
            emitter.emit("file:changed", {
                event: event,
                path: path,
                namespace: namespace
            });
        }
756090
def layer_post_save(instance, *args, **kwargs):
    
    if instance.is_monitored and instance.service.is_monitored:  # index and monitor
        if not settings.REGISTRY_SKIP_CELERY:
            check_layer.delay(instance.id)
        else:
            check_layer(instance.id)
    else:  # just index
        index_layer(instance.id)
861259
private void publishEvent(WSJobExecution execution, WSJobInstance jobInstance, BatchStatus batchStatus) {

        if (batchStatus == BatchStatus.FAILED) {
            publishEvent(execution, BatchEventsPublisher.TOPIC_EXECUTION_FAILED);
            publishEvent(jobInstance, BatchEventsPublisher.TOPIC_INSTANCE_FAILED);
        } else if (batchStatus == BatchStatus.COMPLETED) {
            publishEvent(execution, BatchEventsPublisher.TOPIC_EXECUTION_COMPLETED);
            publishEvent(jobInstance, BatchEventsPublisher.TOPIC_INSTANCE_COMPLETED);
        } else if (batchStatus == BatchStatus.STOPPED) {
            publishEvent(execution, BatchEventsPublisher.TOPIC_EXECUTION_STOPPED);
            publishEvent(jobInstance, BatchEventsPublisher.TOPIC_INSTANCE_STOPPED);
            //smf call to go here, eventually
        } else if (batchStatus == BatchStatus.STOPPING) {
            publishEvent(jobInstance, BatchEventsPublisher.TOPIC_INSTANCE_STOPPING);
            publishEvent(execution, BatchEventsPublisher.TOPIC_EXECUTION_STOPPING);
        } else if (batchStatus == BatchStatus.STARTED) {
            publishEvent(jobInstance, BatchEventsPublisher.TOPIC_INSTANCE_DISPATCHED);
            publishEvent(execution, BatchEventsPublisher.TOPIC_EXECUTION_STARTED);
        }

    }
1191746
function() {
    const changed_keys = store._changed_keys
    if (changed_keys.length === 0) {
      console.error('no keys were changed, yet we are trying to publish a store change')
      return
    }

    // make sure _changed_keys is reset before executing callbacks
    // (if callbacks modify state, the list of keys the callback changed would be wiped out)
    store._changed_keys = []
    store._clearDebounceTimeout()
    store._callback_objs.forEach(obj => obj.callback(changed_keys))
  }
763992
def on_modified(self, event):
        
        if not self._event_error:
            self.logger.info(u"Change detected from an edit on: %s",
                             event.src_path)

            self.compile_dependencies(event.src_path)
1211832
def fire_update_event(self, *args, **kwargs):
        """"""
        for _handler in self._on_update:
            _handler(*args, **kwargs)
1152
def on_modified(self, event):
        """"""
        path = event.src_path
        if path not in self.saw:
            self.saw.add(path)
            self.recompile(path)
1217083
def emitDataChanged(self, regItem):
        
        leftIndex = self.indexFromItem(regItem, col=0)
        rightIndex = self.indexFromItem(regItem, col=-1)

        logger.debug("Data changed: {} ...{}".format(self.data(leftIndex), self.data(rightIndex)))
        self.dataChanged.emit(leftIndex, rightIndex)
622294
def _fire_status_changed(self):
        
        for listener in self._status_listeners:
            try:
                listener.new_media_status(self.status)
            except Exception:  # pylint: disable=broad-except
                _LOGGER.exception("Exception thrown when calling media status "
                                  "callback")
26950
public function postUpdate(LifecycleEventArgs $args): void
    {
        // Get the object and make sure it is what we need.
        $object = $args->getObject();
        if (!$object instanceof PublishableInterface) {
            return;
        }

        // Get the changeset from the unit of work.
        $uow = $args->getObjectManager()->getUnitOfWork();
        $changeset = $uow->getEntityChangeset($object);

        // If the published state changed fire the published event.
        if (isset($changeset['published'])
            && false === $changeset['published'][0]
            && true === $changeset['published'][1]) {
            $event = new EntityPublishedEvent($object);
            $this->event_dispatcher->dispatch(EntityPublishedEvent::NAME, $event);
        }
    }
592688
def _flag_handler(self, play, handler_name, host):
        '''
        
        '''

        found = False
        for x in play.handlers():
            if handler_name == utils.template(play.basedir, x.name, x.module_vars):
                found = True
                self.callbacks.on_notify(host, x.name)
                x.notified_by.append(host)
        if not found:
            raise errors.AnsibleError("change handler (%s) is not defined" % handler_name)
347540
def Publish(self, request, context):
        """"""
        LOG.debug("Publish called")
        try:
            self.plugin.publish(
                [Metric(pb=m) for m in request.Metrics],
                ConfigMap(pb=request.Config)
            )
            return ErrReply()
        except Exception as err:
            msg = "message: {}\n\nstack trace: {}".format(
                err, traceback.format_exc())
            return ErrReply(error=msg)