<commit_before>/* sbt -- Simple Build Tool
 * Copyright 2008, 2009, 2010 <NAME>, <NAME>
 */
package sbt;

trait Dag[Node <: Dag[Node]]{
	self : Node =>

	def dependencies : Iterable[Node]
	def topologicalSort = Dag.topologicalSort(self)(_.dependencies)
}
object Dag
{
	import scala.collection.{mutable, JavaConversions};
	import JavaConversions.{asIterable, asSet}

	// TODO: replace implementation with call to new version
	def topologicalSort[T](root: T)(dependencies: T => Iterable[T]): List[T] = topologicalSort(root :: Nil)(dependencies)
	
	def topologicalSort[T](nodes: Iterable[T])(dependencies: T => Iterable[T]): List[T] =
	{
		val discovered = new mutable.HashSet[T]
		val finished = asSet(new java.util.LinkedHashSet[T])

		def visitAll(nodes: Iterable[T]) = nodes foreach visit
		def visit(dag : T){
			if (!discovered(dag)) {<commit_msg>Remove obsolete comments<commit_after>/* sbt -- Simple Build Tool
 * Copyright 2008, 2009, 2010 <NAME>, <NAME>
 */
package sbt;

trait Dag[Node <: Dag[Node]]{
	self : Node =>

	def dependencies : Iterable[Node]
	def topologicalSort = Dag.topologicalSort(self)(_.dependencies)
}
object Dag
{
	import scala.collection.{mutable, JavaConversions};
	import JavaConversions.{asIterable, asSet}

	def topologicalSort[T](root: T)(dependencies: T => Iterable[T]): List[T] = topologicalSort(root :: Nil)(dependencies)
	
	def topologicalSort[T](nodes: Iterable[T])(dependencies: T => Iterable[T]): List[T] =
	{
		val discovered = new mutable.HashSet[T]
		val finished = asSet(new java.util.LinkedHashSet[T])

		def visitAll(nodes: Iterable[T]) = nodes foreach visit
		def visit(dag : T){
			if (!discovered(dag)) {
{'fraction_non_alphanumeric': 0.14458560193587416, 'fraction_numerical': 0.014519056261343012, 'mean_word_length': 5.2889733840304185, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '742034', 'n_tokens_mistral': 604, 'n_tokens_neox': 530, 'n_words': 140}