// GetSection returns a Section with provided name from File.
505002
func (f *File) GetSection(name string) *Section {
	s, _ := f.getSection(name)
	return s
}
1120394
func (f *File) ChildSections(name string) []*Section {
	return f.Section(name).ChildSections()
}
210204
func (d *Dir) GetNode(nodeName string) (os.FileInfo, error) {
	for _, node := range d.nodes {
		if nodeName == node.Name() {
			return node, nil
		}
	}
	return nil, fmt.Errorf("No find node with name " + nodeName)
}
243238
func (f *File) getSection(name string) (*Section, int) {
	n := f.SectionManipFunc(name)

	// blank section isn't actually defined ...
	if f.sectionNameComp(n, "") {
		return f.sections[0], 0
	}

	// loop through lines and find section
	for idx, line := range f.lines {
		if s, ok := line.item.(*Section); ok && f.sectionNameComp(n, s.name) {
			return s, idx
		}
	}

	return nil, -1
}
1082305
func (f *File) sectionNameComp(a, b string) bool {
	if f.SectionCompFunc != nil {
		return f.SectionCompFunc(a, b)
	}

	return f.SectionNameFunc(a) == f.SectionNameFunc(b)
}
1186348
func (ini *INI) SectionGetBool(section, key string) (bool, bool) {
    v, ok := ini.SectionGet(section, key)
    if ok {
        switch v {
        case "1", "t", "T", "true", "TRUE", "True", "on", "ON", "On", "yes", "YES", "Yes":
            return true, true
        case "0", "f", "F", "false", "FALSE", "False", "off", "OFF", "Off", "no", "NO", "No":
            return false, true
        }
    }

    return false, false
}
122409
func (f *File) AddSection(name string) *Section {
	return f.AddSectionRaw(f.SectionManipFunc(name))
}
1315555
func (ini *INI) GetFloat(key string) (float64, bool) {
    return ini.SectionGetFloat(DefaultSection, key)
}
188128
func GetRegion(d *schema.ResourceData, config *Config) string {
	if v, ok := d.GetOk("region"); ok {
		return v.(string)
	}

	return config.Region
}
803426
func (stor *maas1Storage) Get(name string) (io.ReadCloser, error) {
	name = stor.prefixWithPrivateNamespace(name)
	fileObj, err := stor.retrieveFileObject(name)
	if err != nil {
		return nil, err
	}
	data, err := fileObj.GetField("content")
	if err != nil {
		return nil, fmt.Errorf("could not extract file content for %s: %v", name, err)
	}
	buf, err := base64.StdEncoding.DecodeString(data)
	if err != nil {
		return nil, fmt.Errorf("bad data in file '%s': %v", name, err)
	}
	return ioutil.NopCloser(bytes.NewReader(buf)), nil
}
113958
func (c *Config) Section(name string) *Section {
	for i := len(c.Sections) - 1; i >= 0; i-- {
		s := c.Sections[i]
		if s.IsName(name) {
			return s
		}
	}

	s := &Section{Name: name}
	c.Sections = append(c.Sections, s)
	return s
}
654741
func (section *Section) GetFloat(name string) (float64, error) {
	value, err := section.Get(name)
	if err != nil {
		return float64(0), err
	}

	switch value.(type) {
	case *Primative:
		return value.(*Primative).AsFloat()
	}

	return float64(0), errors.New("could not convert non-primative value to float")
}
581904
func extractSection(s string, start, end rune) (prefix, body, suffix string, found bool) {
	s = trim(s)
	if strings.HasPrefix(s, string(start)) {
		// no prefix
		body = s[1:]
	} else {
		a := strings.SplitN(s, string(start), 2)
		if len(a) != 2 {
			return "", "", s, false
		}
		prefix = a[0]
		body = a[1]
	}
	a := strings.SplitN(body, string(end), 2)
	if len(a) != 2 {
		return "", "", "", false
	}
	return prefix, a[0], a[1], true
}
22239
func (ini *INI) SectionGetFloat(section, key string) (float64, bool) {
    v, ok := ini.SectionGet(section, key)
    if ok {
        v, err := strconv.ParseFloat(v, 64)
        if err == nil {
            return v, true
        }
    }

    return 0.0, ok
}
342025
func (self *Config) AddSection(section string) bool {
	// _DEFAULT_SECTION
	if section == "" {
		return false
	}

	if _, ok := self.data[section]; ok {
		return false
	}

	self.data[section] = make(map[string]*tValue)

	// Section order
	self.idSection[section] = self.lastIdSection
	self.lastIdSection++

	return true
}
56506
func (m *Manifest) SetSection(name, content string) {
	m.getSection(name).content = content
}
1332682
func (d *localeStore) Get(lang, section, format string) (string, bool) {
	if locale, ok := d.store[lang]; ok {
		if key, err := locale.message.Section(section).GetKey(format); err == nil {
			return key.Value(), true
		}
	}

	if len(d.defaultLang) > 0 && lang != d.defaultLang {
		return d.Get(d.defaultLang, section, format)
	}

	return "", false
}