<commit_before>package main

import (
	"fmt"
	"github.com/codegangsta/cli"
	"github.com/keybase/go/libcmdline"
	"github.com/keybase/go/libkb"
	"os"
	"strings"
)

type CmdMykeySelect struct {
	state MyKeyState
	query string
}

func (v *CmdMykeySelect) ParseArgv(ctx *cli.Context) (err error) {
	nargs := len(ctx.Args())
	if err = v.state.ParseArgv(ctx); err != nil {
	} else if nargs == 1 {
		v.query = ctx.Args()[0]
	} else if nargs != 0 {
		err = fmt.Errorf("mkey select takes 0 or 1 arguments")
	}
	return err
}

func (v *CmdMykeySelect) RunClient() error { return v.Run() }
func (v *CmdMykeySelect) Run() (err error) {

	gen := libkb.NewKeyGen(&v.state.arg)

	if err = gen.LoginAndCheckKey(); err != nil {
		return
	}
	if err = v.GetKey(); err != nil {
		return
	}
	if err = v.state.PromptSecretPush(false); err != nil {
		return
	}
	if _, err = gen.Run(); err != nil {
		return
	}
	return
}
func (v *CmdMykeySelect) GetKey() error {

	gpg := G.GetGpgClient()
	if _, err := gpg.Configure(); err != nil {
		return err
	}
	index, err, warns := gpg.Index(true, v.query)
	if err != nil {
		return err
	}
	warns.Warn()
	var keyInfo *libkb.GpgPrimaryKey
	if len(index.Keys) > 1 {
		if len(v.query) > 0 {<commit_msg>get this working again<commit_after>package main

import (
	"fmt"
	"github.com/codegangsta/cli"
	"github.com/keybase/go/libcmdline"
	"github.com/keybase/go/libkb"
	"os"
	"strings"
)

type CmdMykeySelect struct {
	state MyKeyState
	query string
}

func (v *CmdMykeySelect) ParseArgv(ctx *cli.Context) (err error) {
	nargs := len(ctx.Args())
	if err = v.state.ParseArgv(ctx); err != nil {
	} else if nargs == 1 {
		v.query = ctx.Args()[0]
	} else if nargs != 0 {
		err = fmt.Errorf("mkey select takes 0 or 1 arguments")
	}
	return err
}

func (v *CmdMykeySelect) RunClient() error { return v.Run() }
func (v *CmdMykeySelect) Run() (err error) {

	v.state.arg.SecretUI = G_UI.GetSecretUI()
	gen := libkb.NewKeyGen(&v.state.arg)

	if err = gen.LoginAndCheckKey(); err != nil {
		return
	}
	if err = v.GetKey(); err != nil {
		return
	}
	if err = v.state.PromptSecretPush(false); err != nil {
		return
	}
	if _, err = gen.Run(); err != nil {
		return
	}
	return
}
func (v *CmdMykeySelect) GetKey() error {

	gpg := G.GetGpgClient()
	if _, err := gpg.Configure(); err != nil {
		return err
	}
	index, err, warns := gpg.Index(true, v.query)
	if err != nil {
		return err
	}
	warns.Warn()
	var keyInfo *libkb.GpgPrimaryKey
	if len(index.Keys) > 1 {
		if len(v.query) > 0 {
{'fraction_non_alphanumeric': 0.15953150242326333, 'fraction_numerical': 0.005654281098546042, 'mean_word_length': 3.4550359712230216, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '1848509', 'n_tokens_mistral': 1035, 'n_tokens_neox': 998, 'n_words': 253}