<commit_before>package persistence

import (
	ae "appengine"
	ds "appengine/datastore"
	"data"
	"isbn13"
	"strings"
)

const kindBookInfo = "book"

func LookupISBN(ctx ae.Context, country string, isbn isbn13.ISBN13) (resp *data.BookMetaData, err error) {
	key := ds.NewKey(ctx, kindBookInfo, key(country, isbn), 0, nil)
	found := new(data.BookMetaData)
	if err = ds.Get(ctx, key, found); err == nil {
		resp = found
	}

	return
}

func StoreISBNResult(ctx ae.Context, country string, isbn isbn13.ISBN13, data *data.BookMetaData) {
	key := ds.NewKey(ctx, kindBookInfo, key(country, isbn), 0, nil)
	_, err := ds.Put(ctx, key, data)

	ctx.Infof("Put ", isbn, " with result ", err)
}

func key(country string, isbn isbn13.ISBN13) string {
	return strings.Join([]string{country, isbn.String()}, ":")
}<commit_msg>Fixed log message<commit_after>package persistence

import (
	ae "appengine"
	ds "appengine/datastore"
	"data"
	"isbn13"
	"strings"
)

const kindBookInfo = "book"

func LookupISBN(ctx ae.Context, country string, isbn isbn13.ISBN13) (resp *data.BookMetaData, err error) {
	key := ds.NewKey(ctx, kindBookInfo, key(country, isbn), 0, nil)
	found := new(data.BookMetaData)
	if err = ds.Get(ctx, key, found); err == nil {
		resp = found
	}

	return
}

func StoreISBNResult(ctx ae.Context, country string, isbn isbn13.ISBN13, data *data.BookMetaData) {
	key := ds.NewKey(ctx, kindBookInfo, key(country, isbn), 0, nil)
	_, err := ds.Put(ctx, key, data)

	ctx.Infof("Put %s with result %v", isbn.String(), err)
}

func key(country string, isbn isbn13.ISBN13) string {
	return strings.Join([]string{country, isbn.String()}, ":")
}
{'fraction_non_alphanumeric': 0.15224063842848373, 'fraction_numerical': 0.019643953345610803, 'mean_word_length': 4.842293906810036, 'pattern_counts': {'":': 2, '<': 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': '7467607', 'n_tokens_mistral': 645, 'n_tokens_neox': 613, 'n_words': 158}