<commit_before>package ethwire

import (
	"fmt"
	"runtime"
)

// should be used in Peer handleHandshake, incorporate Caps, ProtocolVersion, Pubkey etc.
type ClientIdentity interface {
	String() string
}

type SimpleClientIdentity struct {
	clientString     string
	clientIdentifier string
	version          string
	customIdentifier string
	os               string
	implementation   string
}

func NewSimpleClientIdentity(clientIdentifier string, version string, customIdentifier string) *SimpleClientIdentity {
	clientIdentity := &SimpleClientIdentity{
		clientIdentifier: clientIdentifier,
		version:          version,
		customIdentifier: customIdentifier,
		os:               runtime.GOOS,
		implementation:   "Go",
	}
	clientIdentity.init()
	return clientIdentity
}

func (c *SimpleClientIdentity) init() {
	c.clientString = fmt.Sprintf("%s/v%s/%s/%s/%s",
		c.clientIdentifier,
		c.version,
		c.customIdentifier,
		c.os,
		c.implementation)
}

func (c *SimpleClientIdentity) String() string {
	return c.clientString
}

func (c *SimpleClientIdentity) SetCustomIdentifier(customIdentifier string) {
	c.customIdentifier = customIdentifier
	c.init()
}

func (c *SimpleClientIdentity) GetCustomIdentifier() string {
	return c.customIdentifier
}<commit_msg>Removed extra slash so @nicksavers gets off my back ;-)<commit_after>package ethwire

import (
	"fmt"
	"runtime"
)

// should be used in Peer handleHandshake, incorporate Caps, ProtocolVersion, Pubkey etc.
type ClientIdentity interface {
	String() string
}

type SimpleClientIdentity struct {
	clientIdentifier string
	version          string
	customIdentifier string
	os               string
	implementation   string
}

func NewSimpleClientIdentity(clientIdentifier string, version string, customIdentifier string) *SimpleClientIdentity {
	clientIdentity := &SimpleClientIdentity{
		clientIdentifier: clientIdentifier,
		version:          version,
		customIdentifier: customIdentifier,
		os:               runtime.GOOS,
		implementation:   "Go",
	}

	return clientIdentity
}

func (c *SimpleClientIdentity) init() {
}

func (c *SimpleClientIdentity) String() string {
	var id string
	if len(c.customIdentifier) > 0 {
		id = "/" + c.customIdentifier
	}

	return fmt.Sprintf("%s/v%s%s/%s/%s",
		c.clientIdentifier,
		c.version,
		id,
		c.os,
		c.implementation)
}

func (c *SimpleClientIdentity) SetCustomIdentifier(customIdentifier string) {
	c.customIdentifier = customIdentifier
}

func (c *SimpleClientIdentity) GetCustomIdentifier() string {
	return c.customIdentifier
}
{'fraction_non_alphanumeric': 0.08900316455696203, 'fraction_numerical': 0.00039556962025316455, 'mean_word_length': 4.2907949790794975, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '7118909', 'n_tokens_mistral': 747, 'n_tokens_neox': 713, 'n_words': 195}