// ExpectMap works in the same way of the Expect command, but has a key/value
// input to make it easier to build test environments
774864
func (c *Cmd) ExpectMap(response map[string]string) *Cmd {
	var values []interface{}
	for key, value := range response {
		values = append(values, []byte(key))
		values = append(values, []byte(value))
	}
	c.Responses = append(c.Responses, Response{values, nil})
	return c
}
415431
func readKeyMap(r *bufio.Reader) (key string, msg map[string]interface{}, err error) {
	key, err = readString1(r)
	if err != nil {
		return
	}
	msg, err = readMap(r, false)
	return
}
1058295
func parseMap(m Map) (map[int]interface{}, map[string]string) {
	var options = make(map[int]interface{})
	var headers = make(map[string]string)

	if m == nil {
		return options, headers
	}

	for k, v := range m {
		// integer is option
		if kInt, ok := k.(int); ok {
			// don't need to validate
			options[kInt] = v
		} else if kString, ok := k.(string); ok {
			kStringUpper := strings.ToUpper(kString)
			if kInt, ok := CONST[kStringUpper]; ok {
				options[kInt] = v
			} else {
				// it should be header, but we still need to validate it's type
				if vString, ok := v.(string); ok {
					headers[kString] = vString
				}
			}
		}
	}

	return options, headers
}
1365745
func (e *expectations) Expect(namespace, ingressName, name string) {
	e.lock.Lock()
	defer e.lock.Unlock()
	key := queueKey{namespace: namespace, name: ingressName}
	set, ok := e.expect[key]
	if !ok {
		set = sets.NewString()
		e.expect[key] = set
	}
	set.Insert(name)
}
990305
func (w *newValueWriter) ComputedKeysMap() map[string]bool {
	w.once.Do(w.init)
	return w.computedKeys
}
932911
func main() {
	args := map[string]string{}
	gp := geopattern.URIimage(args)
	fmt.Println(gp)
}
765757
func (t *T) ExpectPanic(f func(), err interface{}, desc ...string) {
	prefix := ""
	if len(desc) > 0 {
		prefix = strings.Join(desc, " ") + ": "
	}
	defer func() {
		i := recover()
		if i == nil {
			t.Fatalf("%sFunction call did not panic as expected.", prefix)
		}
		t.Equal(i, err, "Raised value is not correct")
	}()
	f()
}
990025
func VerifyMap(t Failable, m interface{}) error {
	outputText := utils.PrintMap(m)
	return VerifyString(t, outputText)
}
479802
func (v Value) StringMap() map[string]string {
	tmp := v.StringSlice()
	m := make(map[string]string, len(tmp))
	for _, s := range tmp {
		kv := strings.Split(s, ":")
		if len(kv) > 1 {
			m[strings.TrimSpace(kv[0])] = strings.TrimSpace(kv[1])
		}
	}
	return m
}
103219
func (v *Validator) ErrorMap() map[string][]string {
	errMap := map[string][]string{}
	for _, vr := range v.results {
		if _, found := errMap[vr.field]; found {
			errMap[vr.field] = append(errMap[vr.field], vr.message)
		} else {
			errMap[vr.field] = []string{vr.message}
		}
	}
	return errMap
}
446540
func ExpectEq(expected, actual interface{}, errorParts ...interface{}) {
	expectThat(actual, oglematchers.Equals(expected), 1, errorParts)
}
390500
func (r *RedisStore) GetMap(key string) (map[string]interface{}, error) {
	values, err := r.client.HGetAll(key).Result()
	if err != nil {
		return nil, err
	}

	if len(values) == 0 {
		return nil, nil
	}

	newValues := make(map[string]interface{}, len(values))
	for k, v := range values {
		newValues[k] = v
	}

	return newValues, nil
}
361351
func (em *ExpectationMaximization) Predict(inst base.FixedDataGrid) (ClusterMap, error) {
	if !em.fitted {
		return nil, NoTrainingDataError
	}

	_, n_obs := inst.Size()
	n_feats := len(em.attrs)

	// Numeric attrs
	attrSpecs := base.ResolveAttributes(inst, em.attrs)

	// Build the input matrix
	X := mat.NewDense(n_obs, n_feats, nil)
	inst.MapOverRows(attrSpecs, func(row [][]byte, i int) (bool, error) {
		for j, r := range row {
			X.Set(i, j, base.UnpackBytesToFloat(r))
		}
		return true, nil
	})

	// Vector of predictions
	preds := estimateLogProb(X, em.Params, em.n_comps)

	clusterMap := make(map[int][]int)
	for ix, pred := range vecToInts(preds) {
		clusterMap[pred] = append(clusterMap[pred], ix)
	}

	return ClusterMap(clusterMap), nil
}
1313813
func convertMap(m map[string]string) map[string]interface{} {
	c := make(map[string]interface{}, len(m))
	for k, v := range m {
		c[k] = v
	}
	return c
}
355310
func Expect(t Errorf, have, want interface{}, iter ...int) {
	if !reflect.DeepEqual(have, want) {
		file, line := caller()
		t.Errorf(equal, file, line, exampleNum(iter), have, have, want, want)
	}
}
191867
func (v *baseSchemaVisitor) VisitMap(*proto.Map) {
	v.Kind = "map"
	v.Err = fmt.Errorf("Map type not expected")
}
1178082
func (t *Tree) expect(typs ...tokenType) (token, error) {
	tok := t.nextNonSpace()
	for _, typ := range typs {
		if tok.tokenType == typ {
			return tok, nil
		}
	}

	return tok, newUnexpectedTokenError(tok, typs...)
}