<commit_before>package template

import (
	"bytes"
	"fmt"
	"io"
	"io/ioutil"
	"os"
	"regexp"
	"text/template"
)

type Template struct {
	name string
	path string
	vars map[string]string
}

func New(name, template_path string, vars map[string]string) *Template {
	return &Template{
		name: name,
		path: template_path,
		vars: vars,
	}
}

func (t *Template) Create(w io.Writer) (*Template, error) {
	if _, err := os.Stat(t.path); err == nil {
		tmpl_content, err := ioutil.ReadFile(t.path)
		if err != nil {
			return t, err
		}

		var_names, err := findVars(string(tmpl_content))
		if err != nil {
			return t, err
		}

		var missing_vars []string
		for _, name := range var_names {<commit_msg>Fix templates path<commit_after>package template

import (
	"bytes"
	"fmt"
	"io"
	"io/ioutil"
	"os"
	"regexp"
	"text/template"
)

type Template struct {
	name string
	path string
	vars map[string]string
}

func New(name, templates_path string, vars map[string]string) *Template {
	return &Template{
		name: name,
		path: templates_path + "/" + name,
		vars: vars,
	}
}

func (t *Template) Create(w io.Writer) (*Template, error) {
	if _, err := os.Stat(t.path); err == nil {
		tmpl_content, err := ioutil.ReadFile(t.path)
		if err != nil {
			return t, err
		}

		var_names, err := findVars(string(tmpl_content))
		if err != nil {
			return t, err
		}

		var missing_vars []string
		for _, name := range var_names {
{'fraction_non_alphanumeric': 0.13849431818181818, 'fraction_numerical': 0.0, 'mean_word_length': 3.665562913907285, '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': '3473781', 'n_tokens_mistral': 568, 'n_tokens_neox': 535, 'n_words': 145}