<commit_before>package vcsclient

import (
	"encoding/base64"
	"net/http"
	"net/url"
	"path/filepath"
	"strings"

	"github.com/sourcegraph/go-vcs/vcs"
	muxpkg "github.com/sqs/mux"
)

const (
	// Route names
	RouteRepo          = "repo"
	RouteRepoBranch    = "repo.branch"
	RouteRepoCommit    = "repo.commit"
	RouteRepoCommitLog = "repo.commit.log"
	RouteRepoRevision  = "repo.rev"
	RouteRepoTag       = "repo.tag"
	RouteRepoTreeEntry = "repo.tree-entry"
	RouteRepoUpdate    = "repo.update"
	RouteRoot          = "root"
)

type Router muxpkg.Router

// NewRouter creates a new router that matches and generates URLs that the HTTP
// handler recognizes.
func NewRouter(parent *muxpkg.Router) *Router {
	if parent == nil {
		parent = muxpkg.NewRouter()
	}

	parent.Path("/").Methods("GET").Name(RouteRoot)

	// Encode the repository clone URL as its base64.URLEncoding-encoded string.
	// Add the repository URI after it (as a convenience) so that it's possible
	// to tell which repository is being requested by inspecting the URL, but
	// don't heed this friendly URI when decoding.
	unescapeRepoVars := func(req *http.Request, match *muxpkg.RouteMatch, r *muxpkg.Route) {
		s := match.Vars["CloneURLEscaped"]
		delete(match.Vars, "CloneURLEscaped")
		i := strings.Index(s, "!")
		if i == -1 {
			return<commit_msg>name vcsstore routes with prefix<commit_after>package vcsclient

import (
	"encoding/base64"
	"net/http"
	"net/url"
	"path/filepath"
	"strings"

	"github.com/sourcegraph/go-vcs/vcs"
	muxpkg "github.com/sqs/mux"
)

const (
	// Route names
	RouteRepo          = "vcsstore:repo"
	RouteRepoBranch    = "vcsstore:repo.branch"
	RouteRepoCommit    = "vcsstore:repo.commit"
	RouteRepoCommitLog = "vcsstore:repo.commit.log"
	RouteRepoRevision  = "vcsstore:repo.rev"
	RouteRepoTag       = "vcsstore:repo.tag"
	RouteRepoTreeEntry = "vcsstore:repo.tree-entry"
	RouteRepoUpdate    = "vcsstore:repo.update"
	RouteRoot          = "vcsstore:root"
)

type Router muxpkg.Router

// NewRouter creates a new router that matches and generates URLs that the HTTP
// handler recognizes.
func NewRouter(parent *muxpkg.Router) *Router {
	if parent == nil {
		parent = muxpkg.NewRouter()
	}

	parent.Path("/").Methods("GET").Name(RouteRoot)

	// Encode the repository clone URL as its base64.URLEncoding-encoded string.
	// Add the repository URI after it (as a convenience) so that it's possible
	// to tell which repository is being requested by inspecting the URL, but
	// don't heed this friendly URI when decoding.
	unescapeRepoVars := func(req *http.Request, match *muxpkg.RouteMatch, r *muxpkg.Route) {
		s := match.Vars["CloneURLEscaped"]
		delete(match.Vars, "CloneURLEscaped")
		i := strings.Index(s, "!")
		if i == -1 {
			return
{'fraction_non_alphanumeric': 0.12133431085043989, 'fraction_numerical': 0.0036656891495601175, 'mean_word_length': 3.796133567662566, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5069235', 'n_tokens_mistral': 961, 'n_tokens_neox': 956, 'n_words': 239}