A Helper: Get the list of section
 @return [Hash] list of sections
 @example
 {
   "service_name1" => [
     "section_name1",
     "section_name2",
   ],
   "service_name2" => [
     "section_name1",
     "section_name2",
   ],
 }
322982
def list_section(service_name = nil, section_name = nil, graph_name = nil)
      graphs = list_graph(service_name, section_name, graph_name)
      services = {}
      graphs.each do |graph|
        service_name, section_name = graph['service_name'], graph['section_name']
        services[service_name] ||= {}
        services[service_name][section_name] ||= true
      end
      Hash[services.map {|service_name, sections| [service_name, sections.keys] }]
    end
949260
def read_sections():
    """"""
    config = configparser.ConfigParser()
    config.read(('requirements.ini', 'setup.cfg', 'tox.ini'))
    return [
        (
            name,
            {
                key: parse_value(key, config[name][key])
                for key in config[name]
            }
        )
        for name in config.sections()
        if 'requirements' in name
    ]
228951
function getSections($, root, relative) {

  var items = [];

  var sections = root.children("section[data-type], div[data-type='part']");

  sections.each(function(index, el) {

    var jel = $(el);
    var header = jel.find("> header");

    // create section item
    var item = {
      id: jel.attr("id"),
      type: jel.attr("data-type")
    };

    // find title of section
    var title = header.length ? header.find("> h1, > h2, > h3, > h4, > h5") : jel.find("> h1, > h2, > h3, > h4, > h5");
    if(title.length) {
      item.label = title.first().text();
    }

    // find level of section
    var level;
    if(item.type in levels) {
      level = levels[item.type];
    } else {
      return;
    }

    // find href of section
    item.relative = relative;

    if(level <= maxLevel) {
      item.children = getSections($, jel, relative);
    }

    items.push(item);
  });

  return items;
}
776761
def get_nts_sections(self, sections, sortby=None):
        """"""
        goids = self.get_goids_sections(sections)
        gosubdag = GoSubDag(goids, self.go2obj)
        return [(sec, gosubdag.get_nts(gos, sortby)) for sec, gos in sections]
868877
def get_sections_for_student(id, opts = {})
      data, _status_code, _headers = get_sections_for_student_with_http_info(id, opts)
      return data
    end
694360
def get_section2items(self, itemkey):
        """"""
        sec_items = []
        section2usrnts = self.get_section2usrnts()
        for section, usrnts in section2usrnts.items():
            items = set([e for nt in usrnts for e in getattr(nt, itemkey, set())])
            sec_items.append((section, items))
        return cx.OrderedDict(sec_items)
728131
def sections
      return @sections if @sections
      @sections = []
      path = "event/#{event.key}/performance/#{key}/sections/#{event.client.language_code}"
      result = event.client.call(path, http_method: :get)
      for section in result
        @sections << ShakeTheCounter::Section.new(section, performance: self)
      end
      return @sections
    end
733422
def services(self):
        
        self._services = []
        params = {"f": "json"}
        if not self._url.endswith('/services'):
            uURL = self._url + "/services"
        else:
            uURL = self._url
        res = self._get(url=uURL, param_dict=params,
                           securityHandler=self._securityHandler,
                           proxy_port=self._proxy_port,
                           proxy_url=self._proxy_url)
        for k, v in res.items():
            if k == "foldersDetail":
                for item in v:
                    if 'isDefault' in item and item['isDefault'] == False:
                        fURL = self._url + "/services/" + item['folderName']
                        resFolder = self._get(url=fURL, param_dict=params,
                                                 securityHandler=self._securityHandler,
                                                 proxy_port=self._proxy_port,
                                                 proxy_url=self._proxy_url)
                        for k1, v1 in resFolder.items():
                            if k1 == "services":
                                self._checkservice(k1,v1,fURL)
            elif k == "services":
                self._checkservice(k,v,uURL)
        return self._services
1204314
function getSections() {
    var sections = [];
    // add sections we know about
    for (var name in builtinSections)
      sections.push(builtinSections[name]);
    // add other sections
    for (var i in Espruino.Core.Config.data) {
      var c = Espruino.Core.Config.data[i];
      
      var found = false;
      for (var s in sections)
        if (sections[s].name == c.section)
          found = true;
      
      if (!found) {
        console.warn("Section named "+c.section+" was not added with Config.addSection");
        sections[c.section] = {
            name : c.section,
            sortOrder : 0
        };        
      }
    }
    // Now sort by sortOrder
    sections.sort(function (a,b) { return a.sortOrder - b.sortOrder; });
    
    return sections;
  }
1173379
def services(self):
        ""
        return [self._get_subfolder("%s/%s/" % 
                (s['name'].rstrip('/').split('/')[-1], s['type']), 
                self._service_type_mapping.get(s['type'], Service)) for s
                in self._json_struct.get('services', [])]
1301007
def _get_sections(request):
    
    sections = []
    for section_url in SECTIONS:
        crumb = find_crumb(request, section_url)
        if crumb:
            if section_url == '/':
                if request.path == section_url:
                    crumb.is_current = True
            else:
                if request.path.startswith(section_url):
                    crumb.is_current = True
            sections.append(crumb)

    return sections
804621
def get_sections_for_teacher(id, opts = {})
      data, _status_code, _headers = get_sections_for_teacher_with_http_info(id, opts)
      return data
    end
14963
def _getSectionIds(self, server, sections):
        
        if not sections: return []
        # Get a list of all section ids for looking up each section.
        allSectionIds = {}
        machineIdentifier = server.machineIdentifier if isinstance(server, PlexServer) else server
        url = self.PLEXSERVERS.replace('{machineId}', machineIdentifier)
        data = self.query(url, self._session.get)
        for elem in data[0]:
            allSectionIds[elem.attrib.get('id', '').lower()] = elem.attrib.get('id')
            allSectionIds[elem.attrib.get('title', '').lower()] = elem.attrib.get('id')
            allSectionIds[elem.attrib.get('key', '').lower()] = elem.attrib.get('id')
        log.debug(allSectionIds)
        # Convert passed in section items to section ids from above lookup
        sectionIds = []
        for section in sections:
            sectionKey = section.key if isinstance(section, LibrarySection) else section
            sectionIds.append(allSectionIds[sectionKey.lower()])
        return sectionIds
506017
public List<String> getSectionNames() {
		List<String> sections = new ArrayList<String>();

		for (Map.Entry<String, String> entry : this.entrySet()) {
			String key = entry.getKey();
			int pos = key.indexOf('.');
			if (pos > 0)
				key = key.substring(0, pos);

			// Perform case sensitive search
			boolean found = false;
			for (String section : sections) {
				if (section.equalsIgnoreCase(key)) {
					found = true;
					break;
				}
			}

			if (!found)
				sections.add(key);
		}

		return sections;
	}
1092716
def getlist(self, section, option):
        
        value = self.get(section, option)
        if value:
            return value.split(',')
        else:
            return None
121092
def get_sections(need_info):
    """"""
    sections = []
    current_node = need_info['target_node']
    while current_node:
        if isinstance(current_node, nodes.section):
            title = current_node.children[0].astext()
            # If using auto-section numbering, then Sphinx inserts
            # multiple non-breaking space unicode characters into the title
            # we'll replace those with a simple space to make them easier to
            # use in filters
            title = NON_BREAKING_SPACE.sub(' ', title)
            sections.append(title)
        current_node = getattr(current_node, 'parent', None)
    return sections
305513
def sections(self, kind=None):
        
        result = []
        for section in self.parser.sections():
            # Selected kind only if provided
            if kind is not None:
                try:
                    section_type = self.parser.get(section, "type")
                    if section_type != kind:
                        continue
                except NoOptionError:
                    continue
            result.append(section)
        return result