// copyNodeEvents is a helper to copy a list of NodeEvent's
8126
func copyNodeEvents(events []*NodeEvent) []*NodeEvent {
	l := len(events)
	if l == 0 {
		return nil
	}

	c := make([]*NodeEvent, l)
	for i, event := range events {
		c[i] = event.Copy()
	}
	return c
}
658683
func (p *Parser) handleEvents(rawEvents <-chan []string, send chan<- event.Event, wg *sync.WaitGroup) {
	defer wg.Done()
	// TODO: spin up a group of goroutines to do this
	for rawEvent := range rawEvents {
		ev := p.handleEvent(rawEvent)
		if ev != nil {
			send <- *ev
		}
	}
}
1061551
func (g *Generator) EventType(doms []proto.Domain) {
	g.hasContent = true
	g.Printf(`
// EventType is the type for CDP event names.
type EventType string

func (e EventType) String() string {
	return string(e)
}

// Event methods.
const (`)
	for _, d := range doms {
		for _, e := range d.Events {
			g.Printf("\n\t%s EventType = %q", e.EventName(d), d.Domain+"."+e.NameName)
		}
	}
	g.Printf("\n)\n")
}
789450
func (em *EventManager) AddEvents(ems ...EventSubs) {
	for _, eo := range ems {
		em.AddEvent(eo)
	}
}
840479
func (s *VaultNotificationConfig) SetEvents(v []*string) *VaultNotificationConfig {
	s.Events = v
	return s
}
1144640
func newEvents(c *EventsV1beta1Client, namespace string) *events {
	return &events{
		client: c.RESTClient(),
		ns:     namespace,
	}
}
1174698
func (r *Recorder) Events() []Event {
	r.lock.Lock()
	defer r.lock.Unlock()
	copied := make([]Event, len(r.events))
	copy(copied, r.events)
	return copied
}
635501
func (s *Selection) NotNodes(nodes ...*html.Node) *Selection {
	return pushStack(s, winnowNodes(s, nodes, false))
}
1355360
func newEvents(c *Client, ns string) *events {
	return &events{
		client:    c,
		namespace: ns,
	}
}
1321040
func (lc *LightChain) postChainEvents(events []interface{}) {
	for _, event := range events {
		switch ev := event.(type) {
		case core.ChainEvent:
			if lc.CurrentHeader().Hash() == ev.Hash {
				lc.chainHeadFeed.Send(core.ChainHeadEvent{Block: ev.Block})
			}
			lc.chainFeed.Send(ev)
		case core.ChainSideEvent:
			lc.chainSideFeed.Send(ev)
		}
	}
}
1257452
func Copy(listener func(*vecty.Event)) *vecty.EventListener {
	return &vecty.EventListener{Name: "copy", Listener: listener}
}
1061965
func NewEventID(parent EventID) EventID {
	return EventID{
		Root:   parent.Root,
		ID:     generateID(),
		Parent: parent.ID,
	}
}
994182
func (s *RepositoryTrigger) SetEvents(v []*string) *RepositoryTrigger {
	s.Events = v
	return s
}
833679
func (s *eventLister) Events(namespace string) EventNamespaceLister {
	return eventNamespaceLister{indexer: s.indexer, namespace: namespace}
}
867112
func (d *domainClient) GetEventListeners(ctx context.Context, args *GetEventListenersArgs) (reply *GetEventListenersReply, err error) {
	reply = new(GetEventListenersReply)
	if args != nil {
		err = rpcc.Invoke(ctx, "DOMDebugger.getEventListeners", args, reply, d.conn)
	} else {
		err = rpcc.Invoke(ctx, "DOMDebugger.getEventListeners", nil, reply, d.conn)
	}
	if err != nil {
		err = &internal.OpError{Domain: "DOMDebugger", Op: "GetEventListeners", Err: err}
	}
	return
}
418715
func (e *Event) Clone() *Event {
	var a Args
	var m []byte
	var s []byte

	if n := len(e.Args); n != 0 {
		a = make(Args, n)
		for i := range a {
			a[i].Name = e.Args[i].Name
			a[i].Value = clone(e.Args[i].Value)
		}
	}

	if n := len(e.Message); n != 0 {
		m = make([]byte, n)
		copy(m, e.Message)
	}

	if n := len(e.Source); n != 0 {
		s = make([]byte, n)
		copy(s, e.Source)
	}

	return &Event{
		Message: string(m),
		Source:  string(s),
		Args:    a,
		Time:    e.Time,
		Debug:   e.Debug,
	}
}
178309
func (h *HTTPSink) AddEvents(ctx context.Context, events []*event.Event) (err error) {
	if len(events) == 0 || h.EventEndpoint == "" {
		return nil
	}
	return h.doBottom(ctx, func() (io.Reader, bool, error) {
		return h.encodePostBodyProtobufV2Events(events)
	}, "application/x-protobuf", h.EventEndpoint, datapointAndEventResponseValidator)
}