<commit_before>package ethutil

import (
	"github.com/obscuren/secp256k1-go"
)

type KeyPair struct {
	PrivateKey []byte
	PublicKey  []byte

	// The associated account
	account *StateObject
}

func NewKeyPairFromSec(seckey []byte) (*KeyPair, error) {
	pubkey, err := secp256k1.GeneratePubKey(seckey)
	if err != nil {
		return nil, err
	}

	return &KeyPair{PrivateKey: seckey, PublicKey: pubkey}, nil
}

func NewKeyPairFromValue(val *Value) *KeyPair {
	v, _ := NewKeyPairFromSec(val.Bytes())<commit_msg>Method for creating a new key from scratch<commit_after>package ethutil

import (
	"github.com/obscuren/secp256k1-go"
)

type KeyPair struct {
	PrivateKey []byte
	PublicKey  []byte

	// The associated account
	account *StateObject
}

func GenerateNewKeyPair() (*KeyPair, error) {
	_, prv := secp256k1.GenerateKeyPair()

	return NewKeyPairFromSec(prv)
}

func NewKeyPairFromSec(seckey []byte) (*KeyPair, error) {
	pubkey, err := secp256k1.GeneratePubKey(seckey)
	if err != nil {
		return nil, err
	}

	return &KeyPair{PrivateKey: seckey, PublicKey: pubkey}, nil
}

func NewKeyPairFromValue(val *Value) *KeyPair {
	v, _ := NewKeyPairFromSec(val.Bytes())
{'fraction_non_alphanumeric': 0.1196877710320902, 'fraction_numerical': 0.017346053772766695, 'mean_word_length': 5.105820105820106, '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': '6466751', 'n_tokens_mistral': 433, 'n_tokens_neox': 416, 'n_words': 98}