<commit_before>package httpapi

import (
	"encoding/json"
	"github.com/boivie/lovebeat/service"
	"github.com/gorilla/mux"
	"github.com/op/go-logging"
	"io"
	"net/http"
	"regexp"
	"strconv"
	"time"
)

var (
	client service.ServiceIf
)

func now() int64 { return int64(time.Now().UnixNano() / 1e6) }

var log = logging.MustGetLogger("lovebeat")

func parseTimeout(tmo string) int64 {
	if tmo == "auto" {
		return service.TIMEOUT_AUTO
	} else {
		val, _ := strconv.Atoi(tmo)
		return int64(val) * 1000
	}
}

func ServiceHandler(c http.ResponseWriter, r *http.Request) {
	params := mux.Vars(r)
	name := params["name"]

	var err = r.ParseForm()
	if err != nil {
		log.Error("error parsing form ", err)
		return
	}<commit_msg>Include missing %s verb in httpapi log message.<commit_after>package httpapi

import (
	"encoding/json"
	"github.com/boivie/lovebeat/service"
	"github.com/gorilla/mux"
	"github.com/op/go-logging"
	"io"
	"net/http"
	"regexp"
	"strconv"
	"time"
)

var (
	client service.ServiceIf
)

func now() int64 { return int64(time.Now().UnixNano() / 1e6) }

var log = logging.MustGetLogger("lovebeat")

func parseTimeout(tmo string) int64 {
	if tmo == "auto" {
		return service.TIMEOUT_AUTO
	} else {
		val, _ := strconv.Atoi(tmo)
		return int64(val) * 1000
	}
}

func ServiceHandler(c http.ResponseWriter, r *http.Request) {
	params := mux.Vars(r)
	name := params["name"]

	var err = r.ParseForm()
	if err != nil {
		log.Error("error parsing form: %s", err)
		return
	}
{'fraction_non_alphanumeric': 0.15436696005416384, 'fraction_numerical': 0.018957345971563982, 'mean_word_length': 3.9764309764309766, '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': '3992288', 'n_tokens_mistral': 621, 'n_tokens_neox': 593, 'n_words': 126}