code: func (n *Node) listParents() []*Node {
  	if n.parentsList == nil {
  		// Note: we want to allocate a new slice even if it is empty, so that
  		// n.parentsList is not nil anymore (to indicate we did the calculation
  		// already).
  		n.parentsList = make([]*Node, 0, len(n.parents))
  		seen := make(map[*Key]struct{}, len(n.parents))
  		for _, edge := range n.parents {
  			if _, ok := seen[edge.Parent.Key]; !ok {
  				seen[edge.Parent.Key] = struct{}{}
  				n.parentsList = append(n.parentsList, edge.Parent)
  			}
  		}
  	}
  	return append([]*Node(nil), n.parentsList...)
  }
docs: // listParents returns a slice with a set of direct parents of the node, in
  // order corresponding edges were declared.
  //
  // Must be used only with finalized graphs, since the function caches its result
  // internally on a first call. Returns a copy of the cached result.