<commit_before>package controller

import (
	"time"

	. "eaciit/wfdemo-git/library/core"
	. "eaciit/wfdemo-git/library/helper"
	. "eaciit/wfdemo-git/library/models"
	"eaciit/wfdemo-git/web/helper"

	"github.com/eaciit/dbox"
	_ "github.com/eaciit/dbox/dbc/mongo"
	"github.com/eaciit/knot/knot.v1"
	// tk "github.com/eaciit/toolkit"
	_ "gopkg.in/mgo.v2/bson"
)

type TurbineCollaborationController struct {
	App
}

func CreateTurbineCollaborationController() *TurbineCollaborationController {
	var controller = new(TurbineCollaborationController)
	return controller
}

func (m *TurbineCollaborationController) GetLatest(k *knot.WebContext) interface{} {
	k.Config.OutputType = knot.OutputJson

	payload := struct {
		Take    int
		Turbine string
		Project string
	}{}

	e := k.GetPayload(&payload)
	if e != nil {
		return helper.CreateResult(false, nil, e.Error())
	}

	turbine := payload.Turbine
	project := payload.Project
	take := payload.Take
	tNow := time.Now()
	timestamp = time.Date(tNow.Year(), tNow.Month(), tNow.Day(), 0, 0, 0, 0, time.UTC)

	csr, e := DB().Connection.NewQuery().
		From(new(TurbineCollaborationModel).TableName()).
		Where(
			dbox.And(
				dbox.Eq("turbineid", turbine), 
				dbox.Eq("projectid", project),
				dbox.Gte("date", timestamp)
				)
			).
		Order("-date").Take(take).
		Cursor(nil)
	defer csr.Close()

	if e != nil {
		return helper.CreateResult(false, nil, e.Error())
	}

	turbColls := []TurbineCollaborationModel{}
	e = csr.Fetch(&turbColls, 0, false)
	if e != nil {
		return helper.CreateResult(false, nil, e.Error())
	}
<commit_msg>Missing comma in line 53 54<commit_after>package controller

import (
	"time"

	. "eaciit/wfdemo-git/library/core"
	. "eaciit/wfdemo-git/library/helper"
	. "eaciit/wfdemo-git/library/models"
	"eaciit/wfdemo-git/web/helper"

	"github.com/eaciit/dbox"
	_ "github.com/eaciit/dbox/dbc/mongo"
	"github.com/eaciit/knot/knot.v1"
	// tk "github.com/eaciit/toolkit"
	_ "gopkg.in/mgo.v2/bson"
)

type TurbineCollaborationController struct {
	App
}

func CreateTurbineCollaborationController() *TurbineCollaborationController {
	var controller = new(TurbineCollaborationController)
	return controller
}

func (m *TurbineCollaborationController) GetLatest(k *knot.WebContext) interface{} {
	k.Config.OutputType = knot.OutputJson

	payload := struct {
		Take    int
		Turbine string
		Project string
	}{}

	e := k.GetPayload(&payload)
	if e != nil {
		return helper.CreateResult(false, nil, e.Error())
	}

	turbine := payload.Turbine
	project := payload.Project
	take := payload.Take
	tNow := time.Now()
	timestamp = time.Date(tNow.Year(), tNow.Month(), tNow.Day(), 0, 0, 0, 0, time.UTC)

	csr, e := DB().Connection.NewQuery().
		From(new(TurbineCollaborationModel).TableName()).
		Where(
			dbox.And(
				dbox.Eq("turbineid", turbine),
				dbox.Eq("projectid", project),
				dbox.Gte("date", timestamp),
			),
		).
		Order("-date").Take(take).
		Cursor(nil)
	defer csr.Close()

	if e != nil {
		return helper.CreateResult(false, nil, e.Error())
	}

	turbColls := []TurbineCollaborationModel{}
	e = csr.Fetch(&turbColls, 0, false)
	if e != nil {
		return helper.CreateResult(false, nil, e.Error())
	}

{'fraction_non_alphanumeric': 0.15491621877963957, 'fraction_numerical': 0.00569079987353778, 'mean_word_length': 4.111470113085622, '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': '1199136', 'n_tokens_mistral': 1322, 'n_tokens_neox': 1230, 'n_words': 213}