Listener for SmartContractEvent
        Args:
            sc_event (SmartContractEvent): event to check and see if it contains NEP5Token created
350718
def on_smart_contract_created(self, sc_event: SmartContractEvent):
        
        if isinstance(sc_event.contract, ContractState):
            if not sc_event.test_mode:
                sc_event.CheckIsNEP5()
                if sc_event.token:
                    self._new_contracts_to_write.append(sc_event)
53739
def _detect(self):
        
        results = []
        for c in self.contracts:
            unindexed_params = self.detect_erc20_unindexed_event_params(c)
            if unindexed_params:
                info = "{} ({}) does not mark important ERC20 parameters as 'indexed':\n"
                info = info.format(c.name, c.source_mapping_str)
                for (event, parameter) in unindexed_params:
                    info += "\t-{} ({}) does not index parameter '{}'\n".format(event.name, event.source_mapping_str, parameter.name)

                # Add the events to the JSON (note: we do not add the params/vars as they have no source mapping).
                json = self.generate_json_result(info)
                self.add_functions_to_json([event for event, _ in unindexed_params], json)
                results.append(json)

        return results
252521
async def on_raw_005(self, message):
        
        isupport = {}

        # Parse response.
        # Strip target (first argument) and 'are supported by this server' (last argument).
        for feature in message.params[1:-1]:
            if feature.startswith(FEATURE_DISABLED_PREFIX):
                value = False
            elif '=' in feature:
                feature, value = feature.split('=', 1)
            else:
                value = True
            isupport[feature.upper()] = value

        # Update internal dict first.
        self._isupport.update(isupport)

        # And have callbacks update other internals.
        for entry, value in isupport.items():
            if value != False:
                # A value of True technically means there was no value supplied; correct this for callbacks.
                if value == True:
                    value = None

                method = 'on_isupport_' + pydle.protocol.identifierify(entry)
                if hasattr(self, method):
                    await getattr(self, method)(value)
967124
def create_event(self, timestamp, event_type, hostname, fields, tags=None):
        
        # Agent6 expects a specific set of fields, so we need to place all
        # extra fields in the msg_title and let the Datadog backend separate them
        # Any remaining fields that aren't a part of the datadog-agent payload
        # specification will be dropped.
        event_payload = fields._asdict()

        msg_text = {
            'event_type': event_payload.pop('event_type', None),
            'event_soft_hard': event_payload.pop('event_soft_hard', None),
            'check_name': event_payload.pop('check_name', None),
            'event_state': event_payload.pop('event_state', None),
            'payload': event_payload.pop('payload', None),
            'ack_author': event_payload.pop('ack_author', None),
        }

        msg_text = json.dumps(msg_text)
        self.log.info("Nagios Event pack: {}".format(msg_text))

        event_payload.update(
            {
                'timestamp': timestamp,
                'event_type': event_type,
                'msg_text': msg_text,
                'source_type_name': SOURCE_TYPE_NAME,
                'tags': tags,
            }
        )

        # if host is localhost, turn that into the internal host name
        host = event_payload.get('host', None)
        if host == "localhost":
            event_payload["host"] = hostname
        return event_payload
614040
public void onApplicationEvent(ApplicationEvent event) {

        // All events we care about are subtypes of ClientSecurityEvent
        if( event instanceof ClientSecurityEvent ) {
            Authentication authentication = (Authentication) event.getSource();

            if( logger.isDebugEnabled() ) {
                logger.debug( "RECEIVED ClientSecurityEvent: " + event );
                logger.debug( "Authentication token: " + authentication );
            }

            // Note that we need to inspect the new authentication token and see if it is
            // NO_AUTHENTICATION. If so, then we need to use null instead. This little
            // dance is required because the source of an event can't actually be null.

            if( authentication == ClientSecurityEvent.NO_AUTHENTICATION ) {
                if( logger.isDebugEnabled() ) {
                    logger.debug( "Converted NO_AUTHENTICATION to null" );
                }
                authentication = null;
            }

            // And dispatch according to the event type.

            if( event instanceof AuthenticationEvent ) {
                broadcastAuthentication( authentication );
            } else if( event instanceof LoginEvent ) {
                broadcastLogin( authentication );
            } else if( event instanceof LogoutEvent ) {
                broadcastLogout( authentication );
            } else {
                if( logger.isDebugEnabled() ) {
                    logger.debug( "Unsupported event not processed" );
                }
            }
        }
    }
1017272
def detect_erc20_unindexed_event_params(contract):
        
        # Create our result array
        results = []

        # If this contract isn't an ERC20 token, we return our empty results.
        if not contract.is_erc20():
            return results

        # Loop through all events to look for poor form.
        for event in contract.events:

            # Only handle events which are declared in this contract.
            if event.contract != contract:
                continue

            # If this is transfer/approval events, expect the first two parameters to be indexed.
            if event.full_name in ["Transfer(address,address,uint256)",
                                   "Approval(address,address,uint256)"]:
                if not event.elems[0].indexed:
                    results.append((event, event.elems[0]))
                if not event.elems[1].indexed:
                    results.append((event, event.elems[1]))

        # Return the results.
        return results
614368
def get_token(self, hash):
        
        tokens_snapshot = self.db.prefixed_db(NotificationPrefix.PREFIX_TOKEN).snapshot()

        try:
            val = tokens_snapshot.get(hash.ToBytes())
            if val:
                event = SmartContractEvent.FromByteArray(val)
                return event
        except Exception as e:
            logger.error("Smart contract event with contract hash %s not found: %s " % (hash.ToString(), e))
        return None
138662
private void enableUnsafeSSLRenegotiationCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {
		
		boolean enabled = enableUnsafeSSLRenegotiationCheckBox.isSelected();
		
		if (enabled) {
			JOptionPane.showMessageDialog(null, new String[] {
					Constant.messages.getString("options.cert.label.enableunsafesslrenegotiationwarning")}, 
					Constant.messages.getString("options.cert.label.enableunsafesslrenegotiation"), JOptionPane.INFORMATION_MESSAGE);
		}
	}
1314560
public int subscribe_event(final DeviceProxy deviceProxy,
	            final int event, final int max_size, final boolean stateless) throws DevFailed {
        int id = 0;
        try {
            id = EventConsumerUtil.getInstance().subscribe_event(
                    deviceProxy, event, null, max_size, stateless);
        } catch (final DevFailed e) {
            throw e;
        } catch (final Exception e) {
            Except.throw_communication_failed(e.toString(), "Subscribe event on "
                + name(deviceProxy) + "/" + deviceProxy.devname + " Failed !",
                "DeviceProxy.subscribe_event()");
        }
        return id;
    }
45262
def _register_event_listeners(self, cls):
        
        event.listen(cls, 'after_insert', self._new_listener)
        event.listen(cls, 'after_update', self._update_listener)
        event.listen(cls, 'after_delete', self._delete_listener)
771420
def OnNewGpgKey(self, event):
        

        if gnupg is None:
            return

        if genkey is None:
            # gnupg is not present
            self.interfaces.display_warning(
                _("Python gnupg not found. No key selected."),
                _("Key selection failed."))
        else:
            # gnupg is present
            genkey()
1276641
def start(self):
        
        self._events_to_write = []
        self._new_contracts_to_write = []

        @events.on(SmartContractEvent.CONTRACT_CREATED)
        @events.on(SmartContractEvent.CONTRACT_MIGRATED)
        def call_on_success_event(sc_event: SmartContractEvent):
            self.on_smart_contract_created(sc_event)

        @events.on(SmartContractEvent.RUNTIME_NOTIFY)
        def call_on_event(sc_event: NotifyEvent):
            self.on_smart_contract_event(sc_event)

        Blockchain.Default().PersistCompleted.on_change += self.on_persist_completed
655310
def event_confirmation(self, date, time, pid, commerce_id, transaction_id, request_ip, order_id):
        '''
        '''
        raise NotImplementedError("Logging Handler must implement event_confirmation")
837307
def _nodedev_event_lifecycle_cb(conn, dev, event, detail, opaque):
    '''
    
    '''
    _salt_send_event(opaque, conn, {
        'nodedev': {
            'name': dev.name()
        },
        'event': _get_libvirt_enum_string('VIR_NODE_DEVICE_EVENT_', event),
        'detail': 'unknown'  # currently unused
    })
207279
def on_event(self, evt, is_final):
        
        for msg in XmlHelper.message_iter(evt):
            for node, error in XmlHelper.security_iter(msg.GetElement('securityData')):
                if error:
                    self.security_errors.append(error)
                else:
                    self.on_security_node(node)

        if is_final and self.response_type == 'frame':
            index = self.response.pop('security')
            frame = DataFrame(self.response, columns=self.fields, index=index)
            frame.index.name = 'security'
            self.response = frame
1032732
async def _on_trace_notification(self, trace_event):
        

        conn_string = trace_event.get('connection_string')
        payload = trace_event.get('payload')

        await self.notify_event(conn_string, 'trace', payload)
731949
def model_post_save(sender, instance, created=False, **kwargs):
    

    if sender._meta.app_label == 'rest_framework_reactive':
        # Ignore own events.
        return

    def notify():
        table = sender._meta.db_table
        if created:
            notify_observers(table, ORM_NOTIFY_KIND_CREATE, instance.pk)
        else:
            notify_observers(table, ORM_NOTIFY_KIND_UPDATE, instance.pk)

    transaction.on_commit(notify)