<commit_before>package api

import (
	"database/sql"
	"errors"
	"net/http"
	"strconv"

	"github.com/gin-gonic/gin"
)

var errInvalidParameter = errors.New("Invalid parameter")

func getIntParam(c *gin.Context, name string) (int64, error) {
	result, err := strconv.ParseInt(c.Params.ByName("id"), 10, 64)
	if err != nil {
		return result, errInvalidParameter
	}
	return result, nil
}

func handleError(c *gin.Context, err error) {
	switch err {
	case errInvalidParameter:
		c.AbortWithError(http.StatusBadRequest, err)
		break
	case sql.ErrNoRows:
		c.AbortWithStatus(http.StatusNotFound)
		break
	default:
		c.AbortWithError(http.StatusInternalServerError, err)
	}
}<commit_msg>Ensure name<commit_after>package api

import (
	"database/sql"
	"errors"
	"net/http"
	"strconv"

	"github.com/gin-gonic/gin"
)

var errInvalidParameter = errors.New("Invalid parameter")

func getIntParam(c *gin.Context, name string) (int64, error) {
	result, err := strconv.ParseInt(c.Params.ByName(name), 10, 64)
	if err != nil {
		return result, errInvalidParameter
	}
	return result, nil
}

func handleError(c *gin.Context, err error) {
	switch err {
	case errInvalidParameter:
		c.AbortWithError(http.StatusBadRequest, err)
		break
	case sql.ErrNoRows:
		c.AbortWithStatus(http.StatusNotFound)
		break
	default:
		c.AbortWithError(http.StatusInternalServerError, err)
	}
}
{'fraction_non_alphanumeric': 0.12259970457902511, 'fraction_numerical': 0.008862629246676515, 'mean_word_length': 4.891304347826087, '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': '4059339', 'n_tokens_mistral': 513, 'n_tokens_neox': 490, 'n_words': 105}