<commit_before>package goblin

import (
    "net/url"
    "strconv"
)

type Form url.Values

func (f Form) String(key string) (string, error) {
    val, ok := f[key]
    if !ok {
        return "", ErrKeyIsNotSet
    }
    return val[0], nil
}

func (f Form) Int(key string) (int, error) {
    val, ok := f[key]
    if !ok {
        return 0, ErrKeyIsNotSet
    }
    return strconv.Atoi(val[0])
}

func (f Form) Uint(key string) (uint, error) {
    val, ok := f[key]
    if !ok {
        return 0, ErrKeyIsNotSet
    }
    num, err := strconv.ParseUint(val[0], 10, strconv.IntSize)
    if err != nil {
        return 0, err
    }
    return uint(num), nil
}

func (f Form) Int64(key string) (int64, error) {
    val, ok := f[key]
    if !ok {
        return 0, ErrKeyIsNotSet
    }
    return strconv.ParseInt(val[0], 10, 64)
}

func (f Form) Uint64(key string) (uint64, error) {
    val, ok := f[key]
    if !ok {
        return 0, ErrKeyIsNotSet
    }
    num, err := strconv.ParseInt(val[0], 10, 64)
    if err != nil {
        return 0, err
    }
    return uint64(num), nil
}<commit_msg>fix form<commit_after>package goblin

import (
	"errors"
	"net/url"
	"strconv"
)

var (
	ErrKeyIsNotSet = errors.New("no such key in form")
)

type Form url.Values

func (f Form) String(key string) (string, error) {
	val, ok := f[key]
	if !ok {
		return "", ErrKeyIsNotSet
	}
	return val[0], nil
}

func (f Form) Int(key string) (int, error) {
	val, ok := f[key]
	if !ok {
		return 0, ErrKeyIsNotSet
	}
	return strconv.Atoi(val[0])
}

func (f Form) Uint(key string) (uint, error) {
	val, ok := f[key]
	if !ok {
		return 0, ErrKeyIsNotSet
	}
	num, err := strconv.ParseUint(val[0], 10, strconv.IntSize)
	if err != nil {
		return 0, err
	}
	return uint(num), nil
}

func (f Form) Int64(key string) (int64, error) {
	val, ok := f[key]
	if !ok {
		return 0, ErrKeyIsNotSet
	}
	return strconv.ParseInt(val[0], 10, 64)
}

func (f Form) Uint64(key string) (uint64, error) {
	val, ok := f[key]
	if !ok {
		return 0, ErrKeyIsNotSet
	}
	num, err := strconv.ParseInt(val[0], 10, 64)
	if err != nil {
		return 0, err
	}
	return uint64(num), nil
}
{'fraction_non_alphanumeric': 0.15051740357478832, 'fraction_numerical': 0.02916274694261524, 'mean_word_length': 2.77797513321492, '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': '3770384', 'n_tokens_mistral': 920, 'n_tokens_neox': 869, 'n_words': 247}