// ToMap indicates an expected call of ToMap
435513
func (mr *MockAccessResponderMockRecorder) ToMap() *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ToMap", reflect.TypeOf((*MockAccessResponder)(nil).ToMap))
}
169938
func ToMap(rdr io.Reader, recast ...bool) (map[string]interface{}, error) {
	var r bool
	if len(recast) == 1 {
		r = recast[0]
	}
	n, err := ToTree(rdr)
	if err != nil {
		return nil, err
	}

	m := make(map[string]interface{})
	m[n.key] = n.treeToMap(r)

	return m, nil
}
1188005
func (s *HeaderStorer) headerToMap(headerBase64Encoded string) (map[string]string, error) {
	headerJson, err := base64.StdEncoding.DecodeString(headerBase64Encoded)
	if err != nil {
		return nil, err
	}
	var result map[string]string
	if err := json.Unmarshal([]byte(headerJson), &result); err != nil {
		return nil, err
	}
	return result, nil
}
373868
func (ctx *Context) JSONP(code int, callback string, val interface{}) error {
	buf, err := json.Marshal(val)
	if err != nil {
		return err
	}
	return ctx.JSONPBlob(code, callback, buf)
}
1342369
func (req *MCRequest) ParseTapCommands() (TapConnect, error) {
	rv := TapConnect{
		Flags: map[TapConnectFlag]interface{}{},
		Name:  string(req.Key),
	}

	if len(req.Extras) < 4 {
		return rv, fmt.Errorf("not enough extra bytes: %x", req.Extras)
	}

	flags := TapConnectFlag(binary.BigEndian.Uint32(req.Extras))

	r := bytes.NewReader(req.Body)

	for _, f := range flags.SplitFlags() {
		fun := TapFlagParsers[f]
		if fun == nil {
			fun = TapParseBool
		}

		val, err := fun(r)
		if err != nil {
			return rv, err
		}

		rv.Flags[f] = val
	}

	var err error
	rv.RemainingBody, err = ioutil.ReadAll(r)

	return rv, err
}
956247
func callGet(apiMethod string, params *apiParams, args map[string]interface{}, result interface{}, rules P) (err error) {
	urlParams := url.Values{}
	urlParams.Add("method", apiMethod)
	urlParams.Add("api_key", params.apikey)

	formated, err := formatArgs(args, rules)
	if err != nil {
		return
	}
	for k, v := range formated {
		urlParams.Add(k, v)
	}

	uri := constructUrl(UriApiSecBase, urlParams)

	client := &http.Client{}
	req, err := http.NewRequest("GET", uri, nil)
	if err != nil {
		return
	}
	if params.useragent != "" {
		req.Header.Set("User-Agent", params.useragent)
	}

	res, err := client.Do(req)
	if err != nil {
		return
	}
	if res.StatusCode/100 == 5 { // only 5xx class errors
		err = newLibError(res.StatusCode, res.Status)
		return
	}
	body, err := ioutil.ReadAll(res.Body)
	if err != nil {
		return
	}
	err = parseResponse(body, result)
	return
}
951673
func (f ApiAppHandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request, app *models.App) {
	f(w, r, app)
}
806517
func (c *MountConfig) toMap() (opts map[string]string) {
	isDarwin := runtime.GOOS == "darwin"
	opts = make(map[string]string)

	// Enable permissions checking in the kernel. See the comments on
	// InodeAttributes.Mode.
	opts["default_permissions"] = ""

	// HACK(jacobsa): Work around what appears to be a bug in systemd v219, as
	// shipped in Ubuntu 15.04, where it automatically unmounts any file system
	// that doesn't set an explicit name.
	//
	// When Ubuntu contains systemd v220, this workaround should be removed and
	// the systemd bug reopened if the problem persists.
	//
	// Cf. https://github.com/bazil/fuse/issues/89
	// Cf. https://bugs.freedesktop.org/show_bug.cgi?id=90907
	fsname := c.FSName
	if runtime.GOOS == "linux" && fsname == "" {
		fsname = "some_fuse_file_system"
	}

	// Special file system name?
	if fsname != "" {
		opts["fsname"] = fsname
	}

	subtype := c.Subtype
	if subtype != "" {
		opts["subtype"] = subtype
	}

	// Read only?
	if c.ReadOnly {
		opts["ro"] = ""
	}

	// Handle OS X options.
	if isDarwin {
		if !c.EnableVnodeCaching {
			opts["novncache"] = ""
		}

		if c.VolumeName != "" {
			// Cf. https://github.com/osxfuse/osxfuse/wiki/Mount-options#volname
			opts["volname"] = c.VolumeName
		}
	}

	// OS X: disable the use of "Apple Double" (._foo and .DS_Store) files, which
	// just add noise to debug output and can have significant cost on
	// network-based file systems.
	//
	// Cf. https://github.com/osxfuse/osxfuse/wiki/Mount-options
	if isDarwin {
		opts["noappledouble"] = ""
	}

	// Last but not least: other user-supplied options.
	for k, v := range c.Options {
		opts[k] = v
	}

	return
}
1181356
func main3() {
	api, _ := bandwidth.New(os.Getenv("CATAPULT_USER_ID"), os.Getenv("CATAPULT_API_TOKEN"), os.Getenv("CATAPULT_API_SECRET"))
	fromNumber := os.Args[1]
	toNumber := os.Args[2]
	id, err := api.CreateCall(&bandwidth.CreateCallData{From: fromNumber, To: toNumber})
	if err != nil {
		fmt.Printf("Error: %s", err.Error())
		return
	}
	fmt.Printf("Call ID is %s", id)
}
424975
func valuesToMap(values map[string][]string) map[string]interface{} {
	ret := make(map[string]interface{})

	for key, value := range values {
		if len(value) > 0 {
			ret[key] = value[0]
		}
	}

	return ret
}
430584
func (c *Ctx) JSONP(code int, i interface{}, callback string) (err error) {

	b, e := json.Marshal(i)
	if e != nil {
		err = e
		return
	}

	c.response.Header().Set(ContentType, ApplicationJavaScriptCharsetUTF8)
	c.response.WriteHeader(code)

	if _, err = c.response.Write([]byte(callback + "(")); err == nil {

		if _, err = c.response.Write(b); err == nil {
			_, err = c.response.Write([]byte(");"))
		}
	}

	return
}
500768
func CFDictionaryToMap(cfDict C.CFDictionaryRef) (m map[C.CFTypeRef]uintptr) {
	count := C.CFDictionaryGetCount(cfDict)
	if count > 0 {
		keys := make([]C.CFTypeRef, count)
		values := make([]C.CFTypeRef, count)
		C.CFDictionaryGetKeysAndValues(cfDict, (*unsafe.Pointer)(&keys[0]), (*unsafe.Pointer)(&values[0]))
		m = make(map[C.CFTypeRef]uintptr, count)
		for i := C.CFIndex(0); i < count; i++ {
			k := keys[i]
			v := values[i]
			m[k] = uintptr(v)
		}
	}
	return
}
339096
func (c *Capabilities) ToMap() (map[string]interface{}, error) {
	buf, err := json.Marshal(c)
	if err != nil {
		return nil, err
	}
	m := make(map[string]interface{})
	if err := json.Unmarshal(buf, &m); err != nil {
		return nil, err
	}
	return m, nil
}
22912
func (f nullFunc) toMap() map[Key]ValueSet {
	if !f.k.IsValid() {
		return nil
	}

	return map[Key]ValueSet{
		f.k: NewValueSet(NewBoolValue(f.value)),
	}
}
197022
func NewCodecMap() *CodecMap {
	return &CodecMap{
		addrParsers:  make(map[string]FromNetAddrFunc),
		maddrParsers: make(map[string]ToNetAddrFunc),
	}
}
517540
func StringToMap(str string) (data map[string]string) {
	re := regexp.MustCompile(`\s*([\w-]+)\s*=\s*(['"]?)(.*)`)
	data = make(map[string]string)
	matches := re.FindAllStringSubmatch(str, -1)
	if len(matches) > 0 {
		first := matches[0]
		var reg2_txt string
		if first[2] == "'" || first[2] == `"` {
			reg2_txt = fmt.Sprintf(`([^%s]*)%s(\s+.*)?`, first[2], first[2])
		} else if first[2] == "" {
			reg2_txt = `(\S+)\s*(.*)`
		}
		re2 := regexp.MustCompile(reg2_txt)
		subResult := re2.FindAllStringSubmatch(first[3], -1)

		if len(subResult) > 0 && len(subResult[0]) > 1 {
			data[first[1]] = subResult[0][1]
			if len(subResult[0][2]) > 0 {
				_subResult := StringToMap(subResult[0][2])
				for k, v := range _subResult {
					data[k] = v
				}
			}
		}
	}
	return
}
509218
func tagsToMap(ts []*ec2.Tag) map[string]string {
	result := make(map[string]string)
	for _, t := range ts {
		if !tagIgnored(t) {
			result[*t.Key] = *t.Value
		}
	}

	return result
}