// Inputs returns the array of inputs that defines the Env.
164830
func (perc EnvPerc) Inputs() []Input {
	(&perc).defaults()

	return Env{
		Levels: []Input{C(0), perc.Level, C(0)},
		Times:  []Input{perc.Attack, perc.Release},
		Curve:  []Input{perc.Curve, perc.Curve},
	}.Inputs()
}
47431
func (cutoff EnvCutoff) Inputs() []Input {
	(&cutoff).defaults()

	var (
		levels = []Input{cutoff.Level, C(0)}
		times  = []Input{cutoff.R}
		cts    = []Input{cutoff.CurveType}
	)
	return Env{
		Levels:      levels,
		Times:       times,
		Curve:       cts,
		ReleaseNode: C(0),
	}.Inputs()
}
1203727
func (e Env) Clone() Env {
	clone := e
	clone.env = nil

	if len(e.env) > 0 {
		clone.env = make(map[string]string, len(e.env))
		for k, v := range e.env {
			clone.env[k] = v
		}
	}
	return clone
}
245924
func (e *EnvironmentLoader) PrintEnvs(s interface{}) {
	strct := structs.New(s)
	strctMap := strct.Map()
	prefix := e.getPrefix(strct)

	keys := make([]string, 0, len(strctMap))
	for key := range strctMap {
		keys = append(keys, key)
	}
	sort.Strings(keys)

	for _, key := range keys {
		field := strct.Field(key)
		e.printField(prefix, field, key, strctMap[key])
	}
}
1010968
func (env *Env) Get(key string) (value string) {
	return env.Map()[key]
}
992622
func UInts(input []uint) []uint {
	u := make([]uint, 0, len(input))
	m := make(map[uint]bool)

	for _, val := range input {
		if _, ok := m[val]; !ok {
			m[val] = true
			u = append(u, val)
		}
	}

	return u
}
836194
func (self *Form) Inputs(kv map[string]string) *Form {
	for k, v := range kv {
		if _, ok := self.fields[k]; ok {
			self.fields.Set(k, v)
		}
	}
	return self
}
1066310
func envList(key, def string) []string {
	v := os.Getenv(key)
	if v == "" {
		v = def
	}
	return strings.Fields(v)
}
105623
func (m *Meta) InputMode() terraform.InputMode {
	if test || !m.input {
		return 0
	}

	if envVar := os.Getenv(InputModeEnvVar); envVar != "" {
		if v, err := strconv.ParseBool(envVar); err == nil {
			if !v {
				return 0
			}
		}
	}

	var mode terraform.InputMode
	mode |= terraform.InputModeProvider
	mode |= terraform.InputModeVar
	mode |= terraform.InputModeVarUnset

	return mode
}
810062
func (e *delayedEnvironment) All() map[string][]string {
	e.Load()
	return e.env.All()
}
805076
func (fs *FileSorter) Input(key []types.Datum, val []types.Datum, handle int64) error {
	if fs.closed {
		return errors.New("FileSorter has been closed")
	}
	if fs.fetched {
		return errors.New("call input after output")
	}

	assigned := false
	abortTime := time.Duration(1) * time.Minute           // 1 minute
	cooldownTime := time.Duration(100) * time.Millisecond // 100 milliseconds
	row := &comparableRow{
		key:    key,
		val:    val,
		handle: handle,
	}

	origin := time.Now()
	// assign input row to some worker in a round-robin way
	for {
		for i := 0; i < fs.nWorkers; i++ {
			wid := (fs.cWorker + i) % fs.nWorkers
			if atomic.LoadInt32(&(fs.workers[wid].busy)) == 0 {
				fs.workers[wid].input(row)
				assigned = true
				fs.cWorker = wid
				break
			}
		}
		if assigned {
			break
		}

		// all workers are busy now, cooldown and retry
		time.Sleep(cooldownTime)

		if time.Since(origin) >= abortTime {
			// weird: all workers are busy for at least 1 min
			// choose to abort for safety
			return errors.New("can not make progress since all workers are busy")
		}
	}
	return nil
}
816437
func (p *Prog) keys() []string {
	var keys []string
	for key := range p.Child {
		keys = append(keys, key)
	}
	sort.Strings(keys)
	return keys
}
412837
func (s *SqlApplicationConfiguration) SetInputs(v []*Input) *SqlApplicationConfiguration {
	s.Inputs = v
	return s
}
1041166
func (s *JobClient) AddInputs(ctx context.Context, input *AddJobInputsInput) error {
	fullPath := path.Join("/", s.client.AccountName, "jobs", input.JobID, "live", "in")
	headers := &http.Header{}
	headers.Set("Content-Type", "text/plain")

	reader := strings.NewReader(strings.Join(input.ObjectPaths, "\n"))

	reqInput := client.RequestNoEncodeInput{
		Method:  http.MethodPost,
		Path:    fullPath,
		Headers: headers,
		Body:    reader,
	}
	respBody, _, err := s.client.ExecuteRequestNoEncode(ctx, reqInput)
	if respBody != nil {
		defer respBody.Close()
	}
	if err != nil {
		return errors.Wrap(err, "unable to add job inputs")
	}

	return nil
}
1334638
func (t *Template) WithEnvS(envs []string) *Template {
	var result = map[string]string{}
	for _, env := range envs {
		var parts = strings.SplitN(env, "=", 2)
		result[parts[0]] = parts[1]
	}
	return t.WithEnv(result)
}
606142
func (e *Env) Parse() error {
	for _, name := range e.FieldNames() {
		field, _ := e.Value.Type().FieldByName(name)
		v, err := NewVar(field)

		if err != nil {
			return err
		}
		e.Value.FieldByName(name).Set(v.Value)
		e.Vars = append(e.Vars, v)
	}

	return nil
}
610673
func (t *backupTask) inputs() map[wire.OutPoint]input.Input {
	inputs := make(map[wire.OutPoint]input.Input)
	if t.toLocalInput != nil {
		inputs[*t.toLocalInput.OutPoint()] = t.toLocalInput
	}
	if t.toRemoteInput != nil {
		inputs[*t.toRemoteInput.OutPoint()] = t.toRemoteInput
	}
	return inputs
}