<commit_before>package main

import (
	"encoding/json"
	"fmt"
	"net/http"
	"time"

	"github.com/gorilla/mux"
)

// Index - handle function for index route
func Index(w http.ResponseWriter, r *http.Request) {
	fmt.Fprintln(w, "welcome!")
}

// ModelIndex - handle function for public model route
func ModelIndex(w http.ResponseWriter, r *http.Request) {
	ml := ModelList{
		Model{ID: "0815-4223", Name: "random model 1", CreationDate: time.Now()},
		Model{ID: "007-BOND", Name: "random model 2", CreationDate: time.Now()},
	}

	json.NewEncoder(w).Encode(ml)
}

// ModelDetail - handle function for public model detail route
func ModelDetail(w http.ResponseWriter, r *http.Request) {
	vars := mux.Vars(r)
	modelID := vars["modelId"]
	fmt.Fprintln(w, "model:", modelID)
}
<commit_msg>takes care of some header info<commit_after>package main

import (
	"encoding/json"
	"fmt"
	"net/http"
	"time"

	"github.com/gorilla/mux"
)

// Index - handle function for index route
func Index(w http.ResponseWriter, r *http.Request) {
	fmt.Fprintln(w, "welcome!")
}

// ModelIndex - handle function for public model route
func ModelIndex(w http.ResponseWriter, r *http.Request) {

	//grab this data from a db or whatever
	ml := ModelList{
		Model{ID: "0815-4223", Name: "random model 1", CreationDate: time.Now()},
		Model{ID: "007-BOND", Name: "random model 2", CreationDate: time.Now()},
	}

	//set some header info
	w.Header().Set("Content-Type", "application/json; charset=UTF-8")
	w.WriteHeader(http.StatusOK)

	if err := json.NewEncoder(w).Encode(ml); err != nil {
		panic(err)
	}
}

// ModelDetail - handle function for public model detail route
func ModelDetail(w http.ResponseWriter, r *http.Request) {
	vars := mux.Vars(r)
	modelID := vars["modelId"]
	fmt.Fprintln(w, "model:", modelID)
}

{'fraction_non_alphanumeric': 0.15432098765432098, 'fraction_numerical': 0.015151515151515152, 'mean_word_length': 4.354354354354355, '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': '166700', 'n_tokens_mistral': 661, 'n_tokens_neox': 628, 'n_words': 170}