// ParentIsHead - whether parent is not nil and has <head> tag as parent node
504978
func ParentIsHead(n *html.Node) bool {
	return n != nil && n.Parent != nil && n.Parent.DataAtom == atom.Head
}
467684
func (fs *FSObjects) parentDirIsObject(ctx context.Context, bucket, parent string) bool {
	var isParentDirObject func(string) bool
	isParentDirObject = func(p string) bool {
		if p == "." || p == "/" {
			return false
		}
		if fsIsFile(ctx, pathJoin(fs.fsPath, bucket, p)) {
			// If there is already a file at prefix "p", return true.
			return true
		}

		// Check if there is a file as one of the parent paths.
		return isParentDirObject(path.Dir(p))
	}
	return isParentDirObject(parent)
}
362579
func (s *UpdateFolderInput) SetParentFolderId(v string) *UpdateFolderInput {
	s.ParentFolderId = &v
	return s
}
1104013
func parentKey(parent, child uint64) []byte {
	b := make([]byte, binary.Size([]uint64{parent, child})+1)
	i := binary.PutUvarint(b, parent)
	j := binary.PutUvarint(b[i+1:], child)
	return b[0 : i+j+1]
}
708181
func (p *parser) fosterParent(n *Node) {
	var table, parent, prev *Node
	var i int
	for i = len(p.oe) - 1; i >= 0; i-- {
		if p.oe[i].DataAtom == a.Table {
			table = p.oe[i]
			break
		}
	}

	if table == nil {
		// The foster parent is the html element.
		parent = p.oe[0]
	} else {
		parent = table.Parent
	}
	if parent == nil {
		parent = p.oe[i-1]
	}

	if table != nil {
		prev = table.PrevSibling
	} else {
		prev = parent.LastChild
	}
	if prev != nil && prev.Type == TextNode && n.Type == TextNode {
		prev.Data += n.Data
		return
	}

	parent.InsertBefore(n, table)
}
1046935
func Parent(sc model.SpanContext) SpanOption {
	return func(t *Tracer, s *spanImpl) {
		if sc.Err != nil {
			// encountered an extraction error
			switch t.extractFailurePolicy {
			case ExtractFailurePolicyRestart:
			case ExtractFailurePolicyError:
				panic(s.SpanContext.Err)
			case ExtractFailurePolicyTagAndRestart:
				s.Tags["error.extract"] = sc.Err.Error()
			default:
				panic(ErrInvalidExtractFailurePolicy)
			}
			/* don't use provided SpanContext, but restart trace */
			return
		}
		s.SpanContext = sc
	}
}
1350739
func (xl xlObjects) parentDirIsObject(ctx context.Context, bucket, parent string) bool {
	var isParentDirObject func(string) bool
	isParentDirObject = func(p string) bool {
		if p == "." || p == "/" {
			return false
		}
		if xl.isObject(bucket, p) {
			// If there is already a file at prefix "p", return true.
			return true
		}
		// Check if there is a file as one of the parent paths.
		return isParentDirObject(path.Dir(p))
	}
	return isParentDirObject(parent)
}
1258830
func (s *Selection) ParentsUntil(selector string) *Selection {
	return pushStack(s, getParentsNodes(s.Nodes, compileMatcher(selector), nil))
}
282415
func (s *parentStack) trim(parents []string) error {
	split := 0
	for ; split < len(parents) && split < len(s.stack); split++ {
		if parents[split] != s.stack[split] {
			break
		}
	}
	for i := len(s.stack) - 1; i >= split; i-- {
		if err := s.p.writeEnd(Name{Local: s.stack[i]}); err != nil {
			return err
		}
	}
	s.stack = parents[:split]
	return nil
}
1201615
func (f *sendReceiveFolder) checkParent(file string, scanChan chan<- string) bool {
	parent := filepath.Dir(file)

	if err := osutil.TraversesSymlink(f.fs, parent); err != nil {
		f.newPullError(file, errors.Wrap(err, "checking parent dirs"))
		return false
	}

	// issues #114 and #4475: This works around a race condition
	// between two devices, when one device removes a directory and the
	// other creates a file in it. However that happens, we end up with
	// a directory for "foo" with the delete bit, but a file "foo/bar"
	// that we want to sync. We never create the directory, and hence
	// fail to create the file and end up looping forever on it. This
	// breaks that by creating the directory and scheduling a scan,
	// where it will be found and the delete bit on it removed. The
	// user can then clean up as they like...
	// This can also occur if an entire tree structure was deleted, but only
	// a leave has been scanned.
	if _, err := f.fs.Lstat(parent); !fs.IsNotExist(err) {
		l.Debugf("%v parent not missing %v", f, file)
		return true
	}
	l.Debugf("%v resurrecting parent directory of %v", f, file)
	if err := f.fs.MkdirAll(parent, 0755); err != nil {
		f.newPullError(file, errors.Wrap(err, "resurrecting parent dir"))
		return false
	}
	scanChan <- parent
	return true
}
1106187
func (p Path) ParentPath() *Path {
	return &Path{p.FolderBranch, p.Path[:len(p.Path)-1]}
}
807182
func (l *linkLayerDevice) ParentDevice() (LinkLayerDevice, error) {
	dev, err := l.LinkLayerDevice.ParentDevice()
	if err != nil {
		return nil, errors.Trace(err)
	}
	return &linkLayerDevice{dev}, nil
}
869649
func (t Type) Parents() []string {
	if parents, ok := t.MultipleInheritance(); ok {
		return parents
	}

	if parent, ok := t.SingleInheritance(); ok {
		return []string{parent}
	}
	return []string{}
}
380875
func (p Path) ParentPath() Path {
	if len(p) > 1 {
		return p[:len(p)-1]
	}
	return Path{}
}
1187574
func (l *linkIndex) parents(child *container.Container) map[string]*container.Container {
	l.mu.Lock()

	parents := make(map[string]*container.Container)
	for parent, aliases := range l.childIdx[child] {
		for alias := range aliases {
			parents[alias] = parent
		}
	}

	l.mu.Unlock()
	return parents
}
1015962
func (r *rewinder) Lookahead() *rewinder {
	clone := &rewinder{}
	*clone = *r
	clone.limit = clone.cursor
	return clone
}
698143
func (s *Selection) ParentFiltered(selector string) *Selection {
	return filterAndPush(s, getParentNodes(s.Nodes), compileMatcher(selector))
}