<commit_before>package path

import (
	"fmt"
	"github.com/aybabtme/graph"
)

type PathFinder interface {
	HasPathTo(to int) bool
	PathTo(to int) []int
}

type TremauxDFS struct {
	g      graph.Graph
	from   int
	marked []bool
	edgeTo []int
}

func BuildTremauxDFS(g graph.Graph, from int) PathFinder {

	t := TremauxDFS{
		g:      g,
		from:   from,
		marked: make([]bool, g.V()),
		edgeTo: make([]int, g.V()),
	}

	var visit func(v int)

	steps := 0

	visit = func(v int) {

		t.marked[v] = true
		for _, adj := range g.Adj(v) {
			steps++
			if !t.marked[adj] {
				t.edgeTo[adj] = v<commit_msg>Remove unused import. Parameter checking.<commit_after>package path

import (
	"github.com/aybabtme/graph"
)

type PathFinder interface {
	HasPathTo(to int) bool
	PathTo(to int) []int
}

type TremauxDFS struct {
	g      graph.Graph
	from   int
	marked []bool
	edgeTo []int
}

func BuildTremauxDFS(g graph.Graph, from int) PathFinder {

	if from < 0 {
		panic("Can't start DFS from vertex v < 0")
	}

	if from >= g.V() {
		panic("Can't start DFS from vertex v >= total vertex count")
	}

	t := TremauxDFS{
		g:      g,
		from:   from,
		marked: make([]bool, g.V()),
		edgeTo: make([]int, g.V()),
	}

	var visit func(v int)

	steps := 0

	visit = func(v int) {

		t.marked[v] = true
		for _, adj := range g.Adj(v) {
			steps++
			if !t.marked[adj] {
				t.edgeTo[adj] = v
{'fraction_non_alphanumeric': 0.1486090775988287, 'fraction_numerical': 0.0029282576866764276, 'mean_word_length': 2.9738372093023258, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5773654', 'n_tokens_mistral': 606, 'n_tokens_neox': 553, 'n_words': 150}