<commit_before>// A memory backend.
package memory

import (
	"errors"
	"time"

	"github.com/emersion/imap/backend"
	"github.com/emersion/imap/common"
)

type Backend struct {}

func (bkd *Backend) Login(username, password string) (user backend.User, err error) {
	if username != "username" && password != "password" {
		err = errors.New("Bad username or password")
		return
	}

	now := time.Now()

	user = &User{
		username: username,
		mailboxes: map[string]backend.Mailbox{
			"INBOX": &Mailbox{
				name: "INBOX",
				messages: []*Message{
					&Message{&common.Message{
						Uid: 6,
						Envelope: &common.Envelope{Subject: "Hello World!"},
						BodyStructure: &common.BodyStructure{MimeType: "text", MimeSubType: "plain"},
						Body: map[string]*common.Literal{"BODY[]": common.NewLiteral([]byte("Hi there! How are you?"))},
						Size: 22,
						InternalDate: &now,
					}},
				},
			},
		},
	}
	return
}

func New() *Backend {
	return &Backend{}<commit_msg>Fixes memory backend login<commit_after>// A memory backend.
package memory

import (
	"errors"
	"time"

	"github.com/emersion/imap/backend"
	"github.com/emersion/imap/common"
)

type Backend struct {}

func (bkd *Backend) Login(username, password string) (user backend.User, err error) {
	if username != "username" || password != "password" {
		err = errors.New("Bad username or password")
		return
	}

	now := time.Now()

	user = &User{
		username: username,
		mailboxes: map[string]backend.Mailbox{
			"INBOX": &Mailbox{
				name: "INBOX",
				messages: []*Message{
					&Message{&common.Message{
						Uid: 6,
						Envelope: &common.Envelope{Subject: "Hello World!"},
						BodyStructure: &common.BodyStructure{MimeType: "text", MimeSubType: "plain"},
						Body: map[string]*common.Literal{"BODY[]": common.NewLiteral([]byte("Hi there! How are you?"))},
						Size: 22,
						InternalDate: &now,
					}},
				},
			},
		},
	}
	return
}

func New() *Backend {
	return &Backend{}
{'fraction_non_alphanumeric': 0.16487455197132617, 'fraction_numerical': 0.0030721966205837174, 'mean_word_length': 3.6523809523809523, 'pattern_counts': {'":': 4, '<': 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': '86797', 'n_tokens_mistral': 795, 'n_tokens_neox': 672, 'n_words': 158}