<commit_before>package dondeestas

import (
	"encoding/json"
	"fmt"
	"io"
	"io/ioutil"
	"log"
	"net/http"
	"net/http/httputil"
)

type PersonDataRequest struct {
	Ids []string `json:"ids"`
}

type PersonDataResponse struct {
	People []Person `json:"people"`
}

func PersonRequestHandler(log *log.Logger, db *dbclient, w http.ResponseWriter, r *http.Request) {
	var req PersonDataRequest

	if bytes, err := httputil.DumpRequest(r, true); err != nil {
		log.Println(err)
	} else {
		log.Println(string(bytes))
	}

	if err := getJson(r.Body, &req); err != nil {
		http.Error(w, fmt.Sprintf("%s\n", err), http.StatusUnprocessableEntity)
	} else {
		log.Printf("Received request for people with ids: %v\n", req.Ids)

		var resp PersonDataResponse
		resp.People = make([]Person, 0)

		for _, id := range req.Ids {
			if person, err := (*db).Get(id); err == nil { // TODO: this pointer dereference
				resp.People = append(resp.People, *person)
			}
		}

		if len(resp.People) == len(req.Ids) {<commit_msg>Not printing out something that will never be seen<commit_after>package dondeestas

import (
	"encoding/json"
	"fmt"
	"io"
	"io/ioutil"
	"log"
	"net/http"
	"net/http/httputil"
)

type PersonDataRequest struct {
	Ids []string `json:"ids"`
}

type PersonDataResponse struct {
	People []Person `json:"people"`
}

func PersonRequestHandler(log *log.Logger, db *dbclient, w http.ResponseWriter, r *http.Request) {
	var req PersonDataRequest

	if bytes, err := httputil.DumpRequest(r, true); err == nil {
		log.Println(string(bytes))
	}

	if err := getJson(r.Body, &req); err != nil {
		http.Error(w, fmt.Sprintf("%s\n", err), http.StatusUnprocessableEntity)
	} else {
		log.Printf("Received request for people with ids: %v\n", req.Ids)

		var resp PersonDataResponse
		resp.People = make([]Person, 0)

		for _, id := range req.Ids {
			if person, err := (*db).Get(id); err == nil { // TODO: this pointer dereference
				resp.People = append(resp.People, *person)
			}
		}

		if len(resp.People) == len(req.Ids) {
{'fraction_non_alphanumeric': 0.1560319042871386, 'fraction_numerical': 0.0009970089730807576, 'mean_word_length': 4.030075187969925, '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': '1711295', 'n_tokens_mistral': 760, 'n_tokens_neox': 718, 'n_words': 184}