<commit_before>package lastpass

import (
	"bytes"
)

type Account struct {
	Id       string `json:"id"`
	Name     string `json:"name"`
	Username string `json:"username"`
	Password string `json:"password"`
	Url      string `json:"url"`
	Group    string `json:"group"`
	Notes    string `json:"notes"`
}

type Vault struct {
	Accounts []*Account
}


func CreateVault(username, password string) (*Vault, error) {
	session, err := login(username, password)
	if err != nil {
		return nil, err
	}
	blob, err := fetch(session)
	if err != nil {
		return nil, err
	}
	chunks, err := extractChunks(bytes.NewReader(blob.bytes), []uint32{chunkIdFromString("ACCT")})
	if err != nil {
		return nil, err
	}
	accountChunks := chunks[chunkIdFromString("ACCT")]
	vault := &Vault{Accounts: make([]*Account, len(accountChunks))}

	encryptionKey := makeKey(username, password, blob.keyIterationCount)

	for i, chunk := range accountChunks {
		account, err := parseAccount(bytes.NewReader(chunk), encryptionKey)
		if err != nil {
			return nil, err
		}
		vault.Accounts[i] = account
	}
	return vault, nil
}
<commit_msg>json tag<commit_after>package lastpass

import (
	"bytes"
)

type Account struct {
	Id       string `json:"id"`
	Name     string `json:"name"`
	Username string `json:"username"`
	Password string `json:"password"`
	Url      string `json:"url"`
	Group    string `json:"group"`
	Notes    string `json:"notes"`
}

type Vault struct {
	Accounts []*Account `json:"accounts"`
}

func CreateVault(username, password string) (*Vault, error) {
	session, err := login(username, password)
	if err != nil {
		return nil, err
	}
	blob, err := fetch(session)
	if err != nil {
		return nil, err
	}
	chunks, err := extractChunks(bytes.NewReader(blob.bytes), []uint32{chunkIdFromString("ACCT")})
	if err != nil {
		return nil, err
	}
	accountChunks := chunks[chunkIdFromString("ACCT")]
	vault := &Vault{Accounts: make([]*Account, len(accountChunks))}

	encryptionKey := makeKey(username, password, blob.keyIterationCount)

	for i, chunk := range accountChunks {
		account, err := parseAccount(bytes.NewReader(chunk), encryptionKey)
		if err != nil {
			return nil, err
		}
		vault.Accounts[i] = account
	}
	return vault, nil
}
{'fraction_non_alphanumeric': 0.14285714285714285, 'fraction_numerical': 0.0018140589569160999, 'mean_word_length': 4.42014742014742, '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': '3325704', 'n_tokens_mistral': 768, 'n_tokens_neox': 736, 'n_words': 198}