<commit_before>package db

import (
	"fmt"
	"gopkg.in/mgo.v2"
)

type DBConnection struct {
	session *mgo.Session
}

func NewConnection(host string) (conn *DBConnection) {
	session, err := mgo.Dial(host)
	if err != nil {
		fmt.Println(err)
		panic(err)
	}
	session.SetMode(mgo.Monotonic, true)
	conn = &DBConnection{session}

	return conn
}

func (conn *DBConnection) Use(dbName, tableName string) (db *mgo.Collection) {
	return conn.session.DB(dbName).C(tableName)
}

func (conn *DBConnection) Close() {
	conn.session.Close()
	return
}<commit_msg>update db connection<commit_after>package db

import (
	"gopkg.in/mgo.v2"
)

type DBConnection struct {
	session *mgo.Session
}

func NewConnection(host string) (conn *DBConnection) {
	session, err := mgo.Dial(host)
	if err != nil {
		panic(err)
	}
	session.SetMode(mgo.Monotonic, true)
	conn = &DBConnection{session}

	return conn
}

func (conn *DBConnection) Use(dbName, tableName string) (db *mgo.Collection) {
	return conn.session.DB(dbName).C(tableName)
}

func (conn *DBConnection) Close() {
	conn.session.Close()
	return
}
{'fraction_non_alphanumeric': 0.13834726090993502, 'fraction_numerical': 0.0018570102135561746, 'mean_word_length': 4.764705882352941, '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': '3029381', 'n_tokens_mistral': 416, 'n_tokens_neox': 409, 'n_words': 90}