// Before inserts the matched elements before each element in the set of matched elements.
//
// This follows the same rules as Selection.Append.
779760
func (s *Selection) Before(selector string) *Selection {
	return s.BeforeMatcher(compileMatcher(selector))
}
398910
func BeforeStart(fn func() error) Option {
	return func(o *Options) {
		o.BeforeStart = append(o.BeforeStart, fn)
	}
}
7684
func (l *List) InsertAfter(b, e Element) {
	a := ElementMapper{}.linkerFor(b).Next()
	ElementMapper{}.linkerFor(e).SetNext(a)
	ElementMapper{}.linkerFor(e).SetPrev(b)
	ElementMapper{}.linkerFor(b).SetNext(e)

	if a != nil {
		ElementMapper{}.linkerFor(a).SetPrev(e)
	} else {
		l.tail = e
	}
}
354756
func (l *list) MoveBefore(e, mark *element) {
	if e.list != l || e == mark {
		return
	}
	l.insert(l.remove(e), mark.prev)
}
314758
func (l *ItemList) MoveBefore(e, mark *ItemElement) {
	if e.list != l || e == mark || mark.list != l {
		return
	}
	l.insert(l.remove(e), mark.prev)
}
669120
func (e *element) Prev() *element {
	if p := e.prev; e.list != nil && p != &e.list.root {
		return p
	}
	return nil
}
1106404
func (cp *CallbackProcessor) Before(callbackName string) *CallbackProcessor {
	cp.before = callbackName
	return cp
}
258949
func (c *Checker) BeforeCreate(logger *zap.Logger, spec *unstructured.Unstructured) (*unstructured.Unstructured /*updatedSpec*/, error) {
	processor, ok := c.KnownTypes[spec.GroupVersionKind().GroupKind()]
	if !ok {
		return spec, nil
	}
	ctx := &Context{
		Logger: logger,
		Store:  c.Store,
	}
	updatedSpec, err := processor.BeforeCreate(ctx, spec)
	if err != nil {
		return nil, errors.Wrap(err, "failed to pre-process object specification")
	}
	return util.RuntimeToUnstructured(updatedSpec)
}
487133
func (l *ByteIntervalList) MoveBefore(e, mark *ByteIntervalElement) {
	if e.list != l || e == mark || mark.list != l {
		return
	}
	l.insert(l.remove(e), mark.prev)
}
1151472
func (htmlDoc *htmlDocument) append(e element) {
	htmlDoc.elements = append(htmlDoc.elements, e)
}
135862
func (r *Response) Before(fn func()) {
	r.beforeFuncs = append(r.beforeFuncs, fn)
}
750263
func (s *Deque) Prepend(item interface{}) bool {
	s.Lock()
	defer s.Unlock()

	if s.capacity < 0 || s.container.Len() < s.capacity {
		s.container.PushFront(item)
		return true
	}

	return false
}
809308
func (t Term) Prepend(args ...interface{}) Term {
	return constructMethodTerm(t, "Prepend", p.Term_PREPEND, args, map[string]interface{}{})
}
1323577
func (s *Selection) PrependSelection(sel *Selection) *Selection {
	return s.PrependNodes(sel.Nodes...)
}
356195
func (slist *syncedList) InsertBefore(
	v interface{}, mark *list.Element) *list.Element {

	slist.Lock()
	defer slist.Unlock()

	return slist.queue.InsertBefore(v, mark)
}
407033
func (s *SeqSet) insert(v Seq) {
	i, _ := s.search(v.Start)
	merged := false
	if i > 0 {
		// try merging with the preceding entry (e.g. "1,4".insert(2), i == 1)
		s.Set[i-1], merged = s.Set[i-1].Merge(v)
	}
	if i == len(s.Set) {
		// v was either merged with the last entry or needs to be appended
		if !merged {
			s.insertAt(i, v)
		}
		return
	} else if merged {
		i--
	} else if s.Set[i], merged = s.Set[i].Merge(v); !merged {
		s.insertAt(i, v) // insert in the middle (e.g. "1,5".insert(3), i == 1)
		return
	}
	// v was merged with s.Set[i], continue trying to merge until the end
	for j := i + 1; j < len(s.Set); j++ {
		if s.Set[i], merged = s.Set[i].Merge(s.Set[j]); !merged {
			if j > i+1 {
				// cut out all entries between i and j that were merged
				s.Set = append(s.Set[:i+1], s.Set[j:]...)
			}
			return
		}
	}
	// everything after s.Set[i] was merged
	s.Set = s.Set[:i+1]
}
954476
func (r Range) Before(other Range) bool {
	return !r.End.After(other.Start)
}