<commit_before>package principal

import (
	"fmt"
	"strings"

	vsecurity "v.io/core/veyron/security"

	"v.io/core/veyron2/security"
	"v.io/core/veyron2/verror"
	"v.io/core/veyron2/verror2"
)

func newPrincipal() security.Principal {
	p, err := vsecurity.NewPrincipal()
	if err != nil {
		panic(err)
	}
	return p
}

func blessSelf(p security.Principal, name string) security.Blessings {
	b, err := p.BlessSelf(name)
	if err != nil {
		panic(err)
	}
	return b
}

func matchesError(got error, want string) error {
	if (got == nil) && len(want) == 0 {
		return nil
	}
	if got == nil {
		return fmt.Errorf("Got nil error, wanted to match %q", want)
	}
	if !strings.Contains(got.Error(), want) {
		return fmt.Errorf("Got error %q, wanted to match %q", got, want)
	}
	return nil
}

func matchesErrorID(got error, want verror.ID) error {
	if (got == nil) && len(want) == 0 {
		return nil
	}
	if got == nil {
		return fmt.Errorf("Got nil error, wanted to match %q", want)
	}
	if !verror2.Is(got, want) {
		return fmt.Errorf("Got error %q, wanted to match %q", got, want)
	}
	return nil
}<commit_msg>wspr: Remove verror package, per go/vcl/3921<commit_after>package principal

import (
	"fmt"
	"strings"

	vsecurity "v.io/core/veyron/security"

	"v.io/core/veyron2/security"
	verror "v.io/core/veyron2/verror2"
)

func newPrincipal() security.Principal {
	p, err := vsecurity.NewPrincipal()
	if err != nil {
		panic(err)
	}
	return p
}

func blessSelf(p security.Principal, name string) security.Blessings {
	b, err := p.BlessSelf(name)
	if err != nil {
		panic(err)
	}
	return b
}

func matchesError(got error, want string) error {
	if (got == nil) && len(want) == 0 {
		return nil
	}
	if got == nil {
		return fmt.Errorf("Got nil error, wanted to match %q", want)
	}
	if !strings.Contains(got.Error(), want) {
		return fmt.Errorf("Got error %q, wanted to match %q", got, want)
	}
	return nil
}

func matchesErrorID(got error, want verror.ID) error {
	if (got == nil) && len(want) == 0 {
		return nil
	}
	if got == nil {
		return fmt.Errorf("Got nil error, wanted to match %q", want)
	}
	if !verror.Is(got, want) {
		return fmt.Errorf("Got error %q, wanted to match %q", got, want)
	}
	return nil
}
{'fraction_non_alphanumeric': 0.1498401096391046, 'fraction_numerical': 0.007309273640931932, 'mean_word_length': 3.6496815286624202, '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': '2749011', 'n_tokens_mistral': 879, 'n_tokens_neox': 835, 'n_words': 239}