<commit_before>// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
// Contributor:
// - <NAME> <EMAIL>
package scribe

type Package struct {
	Name    string `json:"name"`
	pkgInfo []PackageInfo
}

type PackageInfo struct {
	Name    string
	Version string
}

func (p *Package) getCriteria() (ret []EvaluationCriteria) {
	for _, x := range p.pkgInfo {
		n := EvaluationCriteria{}
		n.Identifier = x.Name
		n.TestValue = x.Version
		ret = append(ret, n)
	}
	return ret
}

func (p *Package) prepare() error {
	debugPrint("prepare(): preparing information for package \"%v\"\n", p.Name)
	p.pkgInfo = make([]PackageInfo, 0)
	ret := getPackage(p.Name)
	for _, x := range ret.results {
		n := PackageInfo{}
		n.Name = x.name
		n.Version = x.version
		p.pkgInfo = append(p.pkgInfo, n)
	}
	return nil
}

func (p *Package) expandVariables(v []Variable) {
}<commit_msg>variable expansion for target package name<commit_after>// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
// Contributor:
// - <NAME> <EMAIL>
package scribe

type Package struct {
	Name    string `json:"name"`
	pkgInfo []PackageInfo
}

type PackageInfo struct {
	Name    string
	Version string
}

func (p *Package) getCriteria() (ret []EvaluationCriteria) {
	for _, x := range p.pkgInfo {
		n := EvaluationCriteria{}
		n.Identifier = x.Name
		n.TestValue = x.Version
		ret = append(ret, n)
	}
	return ret
}

func (p *Package) prepare() error {
	debugPrint("prepare(): preparing information for package \"%v\"\n", p.Name)
	p.pkgInfo = make([]PackageInfo, 0)
	ret := getPackage(p.Name)
	for _, x := range ret.results {
		n := PackageInfo{}
		n.Name = x.name
		n.Version = x.version
		p.pkgInfo = append(p.pkgInfo, n)
	}
	return nil
}

func (p *Package) expandVariables(v []Variable) {
	p.Name = variableExpansion(v, p.Name)
}
{'fraction_non_alphanumeric': 0.1388888888888889, 'fraction_numerical': 0.004789272030651341, 'mean_word_length': 3.4541577825159915, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '4641887', 'n_tokens_mistral': 736, 'n_tokens_neox': 703, 'n_words': 234}