<commit_before>package auth

import (
	"fmt"
	"path"

	"github.com/jrperritt/rack/internal/github.com/codegangsta/cli"
	"github.com/jrperritt/rack/internal/gopkg.in/ini.v1"
	"github.com/jrperritt/rack/util"
)

func configfile(c *cli.Context, have map[string]authCred, need map[string]string) error {
	var profile string
	if c.GlobalIsSet("profile") {
		profile = c.GlobalString("profile")
	} else if c.IsSet("profile") {
		profile = c.String("profile")
	}
	section, err := Section(profile)
	if err != nil {
		return err
	}
	for opt := range need {
		if val := section.Key(opt).String(); val != "" {
			have[opt] = authCred{value: val, from: fmt.Sprintf("config file (profile: %s)", section.Name())}
			delete(need, opt)
		}
	}
	return nil
}
<commit_msg>default auth options<commit_after>package auth

import (
	"fmt"
	"path"

	"github.com/jrperritt/rack/internal/github.com/codegangsta/cli"
	"github.com/jrperritt/rack/internal/gopkg.in/ini.v1"
	"github.com/jrperritt/rack/util"
)

func configfile(c *cli.Context, have map[string]authCred, need map[string]string) error {
	var profile string
	if c.GlobalIsSet("profile") {
		profile = c.GlobalString("profile")
	} else if c.IsSet("profile") {
		profile = c.String("profile")
	}

	section, err := Section(profile)
	if err != nil {
		return err
	}

	for opt := range need {
		if val := section.Key(opt).String(); val != "" {
			have[opt] = authCred{value: val, from: fmt.Sprintf("config file (profile: %s)", section.Name())}
			delete(need, opt)
		}
	}

	if profile != "" {
		section, err := Section("")
		if err != nil {
			return err
		}

		for opt := range need {
			if val := section.Key(opt).String(); val != "" {
				have[opt] = authCred{value: val, from: fmt.Sprintf("config file (profile: default)")}
				delete(need, opt)
			}
		}
	}

	return nil
}

{'fraction_non_alphanumeric': 0.1688815060908084, 'fraction_numerical': 0.0011074197120708748, 'mean_word_length': 3.870619946091644, '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': '6229091', 'n_tokens_mistral': 720, 'n_tokens_neox': 671, 'n_words': 144}