code: func sortByEdgeOrder(nodes []*Node, orderBy string) []*Node {
  	switch orderBy {
  	case "def":
  		break
  	case "key":
  		sort.Slice(nodes, func(i, j int) bool { return nodes[i].Key.Less(nodes[j].Key) })
  	default:
  		// Must not happen, orderBy must already be validated here.
  		panic(fmt.Sprintf("unknown order %q", orderBy))
  	}
  	return nodes
  }
docs: // sortByEdgeOrder orders either children or parents of some node according to
  // the order of edges to/from them.
  //
  // Assumes 'nodes' came from either .listChildren() or .listParents(), and thus
  // are mutable copies, which are already ordered by 'def' order.
  //
  // Note that 'def' order here means "in order edges were defined". This is
  // different from "in order nodes themselves were defined". This is different
  // from the meaning of 'def' order in SortNodes.