<commit_before>package main

import (
	"log"
	"net/http"

	"github.com/pressly/chi"
	"github.com/pressly/chi/render"
	"github.com/serbe/edc"
)

func listCompanies(w http.ResponseWriter, r *http.Request) {
	type context struct {
		Title     string
		Companies []edc.CompanyList
	}
	companyes, err := db.GetCompanyList()
	if err != nil {
		log.Println("listCompanies db.GetCompanyList ", err)
		return
	}
	ctx := context{Title: "List company", Companies: companyes}
	render.DefaultResponder(w, r, ctx)
}

func getCompany(w http.ResponseWriter, r *http.Request) {
	type context struct {
		Title   string           `json:"title"`
		Company edc.Company      `json:"company"`
		Scopes  []edc.SelectItem `json:"scopes"`
	}
	id := toInt(chi.URLParam(r, "id"))
	company, err := db.GetCompany(id)
	if err != nil {
		log.Println("getCompany db.GetCompany ", err)
		return
	}
	scopesSelect, err := db.GetScopeSelect()
	if err != nil {
		log.Println("getCompany db.GetScopeSelect ", err)
		return
	}
	ctx := context{Title: "Get company", Company: company, Scopes: scopesSelect}
	render.DefaultResponder(w, r, ctx)
}<commit_msg>add missing metadata<commit_after>package main

import (
	"log"
	"net/http"

	"github.com/pressly/chi"
	"github.com/pressly/chi/render"
	"github.com/serbe/edc"
)

func listCompanies(w http.ResponseWriter, r *http.Request) {
	type context struct {
		Title     string            `json:"title"`
		Companies []edc.CompanyList `json:"companies"`
	}
	companyes, err := db.GetCompanyList()
	if err != nil {
		log.Println("listCompanies db.GetCompanyList ", err)
		return
	}
	ctx := context{Title: "List company", Companies: companyes}
	render.DefaultResponder(w, r, ctx)
}

func getCompany(w http.ResponseWriter, r *http.Request) {
	type context struct {
		Title   string           `json:"title"`
		Company edc.Company      `json:"company"`
		Scopes  []edc.SelectItem `json:"scopes"`
	}
	id := toInt(chi.URLParam(r, "id"))
	company, err := db.GetCompany(id)
	if err != nil {
		log.Println("getCompany db.GetCompany ", err)
		return
	}
	scopesSelect, err := db.GetScopeSelect()
	if err != nil {
		log.Println("getCompany db.GetScopeSelect ", err)
		return
	}
	ctx := context{Title: "Get company", Company: company, Scopes: scopesSelect}
	render.DefaultResponder(w, r, ctx)
}
{'fraction_non_alphanumeric': 0.14385964912280702, 'fraction_numerical': 0.0, 'mean_word_length': 4.04646017699115, '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': '1908670', 'n_tokens_mistral': 848, 'n_tokens_neox': 811, 'n_words': 184}