<commit_before>package expr

import (
	"fmt"
	"github.com/grafana/metrictank/schema"
	"math"

	"github.com/grafana/metrictank/api/models"
)

type FuncOffsetToZero struct {
	in GraphiteFunc
}

func NewOffsetToZero() GraphiteFunc {
	return &FuncOffsetToZero{}
}

func (s *FuncOffsetToZero) Signature() ([]Arg, []Arg) {
	return []Arg{
			ArgSeriesList{val: &s.in},
		},
		[]Arg{ArgSeriesList{}}
}

func (s *FuncOffsetToZero) Context(context Context) Context {
	return context
}

func (s *FuncOffsetToZero) Exec(dataMap DataMap) ([]models.Series, error) {
	series, err := s.in.Exec(dataMap)
	if err != nil {
		return nil, err
	}

	outSeries := make([]models.Series, 0, len(series))
	for _, serie := range series {
		serie.Target = fmt.Sprintf("offsetToZero(%s)", serie.Target)<commit_msg>goimports<commit_after>package expr

import (
	"fmt"
	"math"

	"github.com/grafana/metrictank/api/models"
	"github.com/grafana/metrictank/schema"
)

type FuncOffsetToZero struct {
	in GraphiteFunc
}

func NewOffsetToZero() GraphiteFunc {
	return &FuncOffsetToZero{}
}

func (s *FuncOffsetToZero) Signature() ([]Arg, []Arg) {
	return []Arg{
			ArgSeriesList{val: &s.in},
		},
		[]Arg{ArgSeriesList{}}
}

func (s *FuncOffsetToZero) Context(context Context) Context {
	return context
}

func (s *FuncOffsetToZero) Exec(dataMap DataMap) ([]models.Series, error) {
	series, err := s.in.Exec(dataMap)
	if err != nil {
		return nil, err
	}

	outSeries := make([]models.Series, 0, len(series))
	for _, serie := range series {
		serie.Target = fmt.Sprintf("offsetToZero(%s)", serie.Target)
{'fraction_non_alphanumeric': 0.1534526854219949, 'fraction_numerical': 0.0012787723785166241, 'mean_word_length': 4.90566037735849, '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': '5539963', 'n_tokens_mistral': 597, 'n_tokens_neox': 579, 'n_words': 125}