// Change event message
162274
func (p *Project) Change(event fsnotify.Event) {
	if p.parent.Change != nil {
		p.parent.Change(Context{Project: p, Event: event})
		return
	}
	// file extension
	ext := ext(event.Name)
	if ext == "" {
		ext = "DIR"
	}
	// change message
	msg = fmt.Sprintln(p.pname(p.Name, 4), ":", Magenta.Bold(strings.ToUpper(ext)), "changed", Magenta.Bold(event.Name))
	out = BufferOut{Time: time.Now(), Text: ext + " changed " + event.Name}
	p.stamp("log", out, msg, "")
}
124079
func (ev *ChangeEvent) Done(err error) {
	//TODO publish response to the topic
	if err != nil {
		logrus.DefaultLogger().Error(err)
	}
}
307870
func HashChange(listener func(*vecty.Event)) *vecty.EventListener {
	return &vecty.EventListener{Name: "hashchange", Listener: listener}
}
273022
func (ne *NodeEvent) SetMessage(msg string) *NodeEvent {
	ne.Message = msg
	return ne
}
1292177
func PitchWheelChange(channel, int, val int) *Event {
	return &Event{
		MsgChan:      uint8(channel),
		MsgType:      uint8(EventByteMap["PitchWheelChange"]),
		AbsPitchBend: uint16(val),
	}
}
278567
func (w *HubWatcher) queueChange(change Change) {
	w.changeCount++
	w.logger.Tracef("%p got change document: %#v", w, change)
	key := watchKey{change.C, change.Id}
	revno := change.Revno

	// Queue notifications for per-collection watches.
	for _, info := range w.watches[watchKey{change.C, nil}] {
		if info.filter != nil && !info.filter(change.Id) {
			continue
		}
		evt := event{
			ch:    info.ch,
			key:   key,
			revno: revno,
		}
		w.syncEvents = append(w.syncEvents, evt)
		w.syncEventCollectionCount++
		w.logger.Tracef("%p adding event for collection %q watch %v, syncEvents: len(%d), cap(%d)", w, change.C, info.ch, len(w.syncEvents), cap(w.syncEvents))
	}

	// Queue notifications for per-document watches.
	infos := w.watches[key]
	for i, info := range infos {
		if revno > info.revno || revno < 0 && info.revno >= 0 {
			infos[i].revno = revno
			evt := event{
				ch:    info.ch,
				key:   key,
				revno: revno,
			}
			w.syncEvents = append(w.syncEvents, evt)
			w.syncEventDocCount++
			w.logger.Tracef("%p adding event for %v watch %v, syncEvents: len(%d), cap(%d)", w, key, info.ch, len(w.syncEvents), cap(w.syncEvents))
		}
	}
}
1085523
func DeviceChange(listener func(*vecty.Event)) *vecty.EventListener {
	return &vecty.EventListener{Name: "devicechange", Listener: listener}
}
338600
func (d *AllocDir) ChangeEvents(ctx context.Context, path string, curOffset int64) (*watch.FileChanges, error) {
	if escapes, err := structs.PathEscapesAllocDir("", path); err != nil {
		return nil, fmt.Errorf("Failed to check if path escapes alloc directory: %v", err)
	} else if escapes {
		return nil, fmt.Errorf("Path escapes the alloc directory")
	}

	t := &tomb.Tomb{}
	go func() {
		<-ctx.Done()
		t.Kill(nil)
	}()

	// Get the path relative to the alloc directory
	p := filepath.Join(d.AllocDir, path)
	watcher := getFileWatcher(p)
	return watcher.ChangeEvents(t, curOffset)
}
666480
func NewActualLRPInstanceChangedEvent(before, after *ActualLRP) *ActualLRPInstanceChangedEvent {
	var (
		actualLRPKey         ActualLRPKey
		actualLRPInstanceKey ActualLRPInstanceKey
	)

	if (before != nil && before.ActualLRPKey != ActualLRPKey{}) {
		actualLRPKey = before.ActualLRPKey
	}
	if (after != nil && after.ActualLRPKey != ActualLRPKey{}) {
		actualLRPKey = after.ActualLRPKey
	}

	if (before != nil && before.ActualLRPInstanceKey != ActualLRPInstanceKey{}) {
		actualLRPInstanceKey = before.ActualLRPInstanceKey
	}
	if (after != nil && after.ActualLRPInstanceKey != ActualLRPInstanceKey{}) {
		actualLRPInstanceKey = after.ActualLRPInstanceKey
	}

	return &ActualLRPInstanceChangedEvent{
		ActualLRPKey:         actualLRPKey,
		ActualLRPInstanceKey: actualLRPInstanceKey,
		Before:               before.ToActualLRPInfo(),
		After:                after.ToActualLRPInfo(),
	}
}
517660
func LevelChange(listener func(*vecty.Event)) *vecty.EventListener {
	return &vecty.EventListener{Name: "levelchange", Listener: listener}
}
430034
func (flag *NetworkFlag) Change(device types.BaseVirtualDevice, update types.BaseVirtualDevice) {
	current := device.(types.BaseVirtualEthernetCard).GetVirtualEthernetCard()
	changed := update.(types.BaseVirtualEthernetCard).GetVirtualEthernetCard()

	current.Backing = changed.Backing

	if changed.MacAddress != "" {
		current.MacAddress = changed.MacAddress
	}

	if changed.AddressType != "" {
		current.AddressType = changed.AddressType
	}
}
134314
func Message(buffer Buffer, event *cue.Event) {
	buffer.AppendString(event.Message)
}
866578
func (c KbfsClient) FSOnlineStatusChangedEvent(ctx context.Context, online bool) (err error) {
	__arg := FSOnlineStatusChangedEventArg{Online: online}
	err = c.Cli.Call(ctx, "keybase.1.kbfs.FSOnlineStatusChangedEvent", []interface{}{__arg}, nil)
	return
}
662877
func (l Listener) OnChannelChange(e *gumble.ChannelChangeEvent) {
	if l.ChannelChange != nil {
		l.ChannelChange(e)
	}
}
751534
func ControlEvent(v interface{}) *Event {
	event := NewEvent(v)
	event.Control = true
	return event
}
963666
func updateMessage(message editingMessage) error {
	return createMessage(message, message.NumericSender(), message.NumericReference(), message.Text(), message.Language())
}
996570
func (n *Node) handleChanges(changes []Change) {
	n.disseminator.AdjustMaxPropagations()
	for _, change := range changes {
		n.disseminator.RecordChange(change)

		switch change.Status {
		case Alive:
			n.stateTransitions.Cancel(change)

		case Suspect:
			n.stateTransitions.ScheduleSuspectToFaulty(change)

		case Faulty:
			n.stateTransitions.ScheduleFaultyToTombstone(change)

		case Leave:
			// XXX: should this also reap?
			n.stateTransitions.Cancel(change)

		case Tombstone:
			n.stateTransitions.ScheduleTombstoneToEvict(change)
		}
	}
}