<commit_before>package main

import (
	"crypto/rand"
	"fmt"
	"log"
	"net/http"
	"os"

	"gopkg.in/mgo.v2"

	"github.com/labstack/echo"
	"github.com/labstack/echo/engine/standard"
	"github.com/labstack/echo/middleware"
)

type Player struct {
	Name  string
	Token string
	Email string
}

func randToken() string {
	b := make([]byte, 42)
	rand.Read(b)
	return fmt.Sprintf("%x", b)
}

func signup(player *mgo.Collection) echo.HandlerFunc {
	return func(c echo.Context) error {
		u := &Player{}
		if err := c.Bind(u); err != nil {
			return err
		}
		u.Token = randToken()

		if err := player.Insert(u); err != nil {
			return err
		}

		log.Printf("Inserted new user %q\n", u)

		return c.JSON(http.StatusCreated, u)
	}
}

func main() {
	mongoAddr := os.Getenv("MONGO_CONNECTION")
	mongoDbName := os.Getenv("MONGO_DB_NAME")
	session, err := mgo.Dial(mongoAddr)
	if err != nil {
		panic(err)
	}
	defer session.Close()

	players := session.DB(mongoDbName).C("players")

	e := echo.New()
	e.Use(middleware.Logger())
	e.Use(middleware.Recover())
	e.Use(middleware.CORS())

	e.Static("/", "public")

	e.GET("/api/hello", func(c echo.Context) error {
		return c.String(http.StatusOK, "Hello, Contest Framework!\n")
	})

	e.POST("/api/v1/user/signup", signup(players))

	log.Println("Contest Framework starting at port 9000")
	e.Run(standard.New(":9000"))
}
<commit_msg>add manager dependency<commit_after>package main

import (
	"crypto/rand"
	"fmt"
	"log"
	"net/http"
	"os"

	"gopkg.in/mgo.v2"

	"github.com/labstack/echo"
	"github.com/labstack/echo/engine/standard"
	"github.com/labstack/echo/middleware"

	"github.com/non-player-games/manager"
)

type Player struct {
	Name  string
	Token string
	Email string
}

func randToken() string {
	b := make([]byte, 42)
	rand.Read(b)
	return fmt.Sprintf("%x", b)
}

func signup(player *mgo.Collection) echo.HandlerFunc {
	return func(c echo.Context) error {
		u := &Player{}
		if err := c.Bind(u); err != nil {
			return err
		}
		u.Token = randToken()

		if err := player.Insert(u); err != nil {
			return err
		}

		log.Printf("Inserted new user %q\n", u)

		return c.JSON(http.StatusCreated, u)
	}
}

func main() {
	manager.Hello()

	mongoAddr := os.Getenv("MONGO_CONNECTION")
	mongoDbName := os.Getenv("MONGO_DB_NAME")
	session, err := mgo.Dial(mongoAddr)
	if err != nil {
		panic(err)
	}
	defer session.Close()

	players := session.DB(mongoDbName).C("players")

	e := echo.New()
	e.Use(middleware.Logger())
	e.Use(middleware.Recover())
	e.Use(middleware.CORS())

	e.Static("/", "public")

	e.GET("/api/hello", func(c echo.Context) error {
		return c.String(http.StatusOK, "Hello, Contest Framework!\n")
	})

	e.POST("/api/v1/user/signup", signup(players))

	log.Println("Contest Framework starting at port 9000")
	e.Run(standard.New(":9000"))
}

{'fraction_non_alphanumeric': 0.17666068222621184, 'fraction_numerical': 0.008617594254937163, 'mean_word_length': 3.9135802469135803, 'pattern_counts': {'":': 2, '<': 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': '2023372', 'n_tokens_mistral': 1179, 'n_tokens_neox': 1103, 'n_words': 218}