<commit_before>package api

import (
	"bytes"
	"encoding/json"
	"fmt"
	"io/ioutil"
	"log"
	"net/http"
	"net/url"
	"strconv"
	"time"

	"github.com/golangbox/gobox/structs"
)

const (
	ApiEndpoint = "http://10.0.8.98:8000/"
	UDPEndpoint = "http://10.0.8.98:4242"
)

type Api struct {
	SessionKey string
}

func New(SessionKey string) (c Api) {
	resp, err := http.Get(ApiEndpoint + "login/")
	if err != nil {
		log.Fatal(err)
	}
	keyBytes, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	c.SessionKey = string(keyBytes)
	return
}

func (c *Api) apiRequest(endpoint string, body []byte,
	fileType string) (*http.Response, error) {
	return http.Post(
		ApiEndpoint+endpoint+"/?SessionKey="+c.SessionKey,
		"application/json",
		bytes.NewBuffer(body),
	)
}
<commit_msg>changed server addresses to point at localhost<commit_after>package api

import (
	"bytes"
	"encoding/json"
	"fmt"
	"io/ioutil"
	"log"
	"net/http"
	"net/url"
	"strconv"
	"time"

	"github.com/golangbox/gobox/structs"
)

const (
	ApiEndpoint = "http://localhost:8000/"
	UDPEndpoint = "localhost:4242"
)

type Api struct {
	SessionKey string
}

func New(SessionKey string) (c Api) {
	resp, err := http.Get(ApiEndpoint + "login/")
	if err != nil {
		log.Fatal(err)
	}
	keyBytes, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	c.SessionKey = string(keyBytes)
	return
}

func (c *Api) apiRequest(endpoint string, body []byte,
	fileType string) (*http.Response, error) {
	return http.Post(
		ApiEndpoint+endpoint+"/?SessionKey="+c.SessionKey,
		"application/json",
		bytes.NewBuffer(body),
	)
}

{'fraction_non_alphanumeric': 0.16458072590738423, 'fraction_numerical': 0.017521902377972465, 'mean_word_length': 4.108626198083067, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '5785339', 'n_tokens_mistral': 682, 'n_tokens_neox': 648, 'n_words': 130}