<commit_before>package library

const (
	_ = iota
	// GraphTypeArea represents an area graph type.
	GraphTypeArea
	// GraphTypeLine represents a line graph type.
	GraphTypeLine
)

const (
	_ = iota
	// StackModeNone represents a null stack mode.
	StackModeNone
	// StackModeNormal represents a normal stack mode.
	StackModeNormal
	// StackModePercent represents a percentage stack mode.
	StackModePercent
)

// Graph represents a graph containing list of series.
type Graph struct {
	Item
	Type      int          `json:"type"`
	StackMode int          `json:"stack_mode"`
	Groups    []*OperGroup `json:"groups"`
}

// OperGroup represents an operation group entry.
type OperGroup struct {
	Name    string                 `json:"name"`
	Type    int                    `json:"type"`
	StackID int                    `json:"stack_id"`
	Series  []*Serie               `json:"series"`
	Scale   float64                `json:"scale"`
	Options map[string]interface{} `json:"options"`
}

// Serie represents a serie entry.
type Serie struct {
	Name   string  `json:"name"`
	Origin string  `json:"origin"`
	Source string  `json:"source"`
	Metric string  `json:"metric"`
	Scale  float64 `json:"scale"`
}<commit_msg>Add `String()` method to library/graph structs<commit_after>package library

import (
	"fmt"
	"strings"
)

const (
	_ = iota
	// GraphTypeArea represents an area graph type.
	GraphTypeArea
	// GraphTypeLine represents a line graph type.
	GraphTypeLine
)

const (
	_ = iota
	// StackModeNone represents a null stack mode.
	StackModeNone
	// StackModeNormal represents a normal stack mode.
	StackModeNormal
	// StackModePercent represents a percentage stack mode.
	StackModePercent
)

// Graph represents a graph containing list of series.
type Graph struct {
	Item
	Type      int          `json:"type"`
	StackMode int          `json:"stack_mode"`
	Groups    []*OperGroup `json:"groups"`
}

// OperGroup represents an operation group entry.
type OperGroup struct {
	Name    string                 `json:"name"`
	Type    int                    `json:"type"`
	StackID int                    `json:"stack_id"`
	Series  []*Serie               `json:"series"`
	Scale   float64                `json:"scale"`
	Options map[string]interface{} `json:"options"`
}

// Serie represents a serie entry.
type Serie struct {
	Name   string  `json:"name"`
	Origin string  `json:"origin"`
	Source string  `json:"source"`
	Metric string  `json:"metric"`
	Scale  float64 `json:"scale"`
}

func (graph *Graph) String() string {
	return fmt.Sprintf(
		"Graph{ID:\"%s\" Name:\"%s\" Type:%d Groups:[%s]}",
		graph.Name,
		graph.ID,
		graph.Type,
		func(groups []*OperGroup) string {
			groupStrings := make([]string, len(groups))

			for i, group := range groups {
				groupStrings[i] = fmt.Sprintf("%s", group)
			}

			return strings.Join(groupStrings, ", ")
		}(graph.Groups),
	)
}

func (group *OperGroup) String() string {
	return fmt.Sprintf(
		"OperGroup{Name:\"%s\" Type:%d Scale:%f Series:[%s]}",
		group.Name,
		group.Type,
		group.Scale,
		func(series []*Serie) string {
			serieStrings := make([]string, len(series))

			for i, serie := range series {
				serieStrings[i] = fmt.Sprintf("%s", serie)
			}

			return strings.Join(serieStrings, ", ")
		}(group.Series),
	)
}

func (serie *Serie) String() string {
	return fmt.Sprintf(
		"Serie{Name:\"%s\" Origin:\"%s\" Source:\"%s\" Metric:\"%s\" Scale:%f}",
		serie.Name,
		serie.Origin,
		serie.Source,
		serie.Metric,
		serie.Scale,
	)
}
{'fraction_non_alphanumeric': 0.13176064441887228, 'fraction_numerical': 0.0023014959723820483, 'mean_word_length': 3.0336426914153134, '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': '5279520', 'n_tokens_mistral': 1138, 'n_tokens_neox': 1093, 'n_words': 311}