Returns first non-DEFAULT section; falls back to DEFAULT.
180732
def get_default_section(self, file_name):
        """"""
        if not os.path.isfile(file_name):
            return 'DEFAULT'
        parser = self.make_parser()
        with open(file_name) as fp:
            parser.read_file(fp)
        sections = parser.sections()
        section = sections[0] if len(sections) > 0 else 'DEFAULT'
        return section
855062
def get(self):
        
        section = {}
        if self.key is not None and self.value is not None:
            section[self.key] = self.value
        return section
777826
def getFirstUrn(self, reference=None):
        
        if reference is not None:
            if ":" in reference:
                urn = reference
            else:
                urn = "{}:{}".format(
                    str(URN(str(self.urn)).upTo(URN.NO_PASSAGE)),
                    str(reference)
                )
        else:
            urn = str(self.urn)
        _first = _SharedMethod.firstUrn(
            self.retriever.getFirstUrn(
                urn
            )
        )
        return _first
15752
def goBack(self):
        
        index = self.indexOf(self.currentEditor())
        if index == -1:
            return
        
        previous = self.editorAt(index - 1)
        if previous:
            previous.setFocus()
            previous.setCursorPosition(self.sectionLength())
1220381
def get_reference_section_beginning(fulltext):
    """"""
    sect_start = {
        'start_line': None,
        'end_line': None,
        'title_string': None,
        'marker_pattern': None,
        'marker': None,
        'how_found_start': None,
    }

    # Find start of refs section:
    sect_start = find_reference_section(fulltext)
    if sect_start is not None:
        sect_start['how_found_start'] = 1
    else:
        # No references found - try with no title option
        sect_start = find_reference_section_no_title_via_brackets(fulltext)
        if sect_start is not None:
            sect_start['how_found_start'] = 2
        # Try weaker set of patterns if needed
        if sect_start is None:
            # No references found - try with no title option (with weaker
            # patterns..)
            sect_start = find_reference_section_no_title_via_dots(fulltext)
            if sect_start is not None:
                sect_start['how_found_start'] = 3
            if sect_start is None:
                # No references found - try with no title option (with even
                # weaker patterns..)
                sect_start = find_reference_section_no_title_via_numbers(
                    fulltext)
                if sect_start is not None:
                    sect_start['how_found_start'] = 4

    if sect_start:
        current_app.logger.debug('* title %r' % sect_start['title_string'])
        current_app.logger.debug('* marker %r' % sect_start['marker'])
        current_app.logger.debug('* title_marker_same_line %s'
                                 % sect_start['title_marker_same_line'])
    else:
        current_app.logger.debug('* could not find references section')
    return sect_start
61920
public function section($name, $default = null)
    {
        if (!isset($this->sections[$name])) {
            return $default;
        }

        return $this->sections[$name];
    }
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]
1117813
def get_config(section, option, allow_empty_option=True, default=""):
    '''
    
    '''
    try:
        value = config.get(section, option)
        if value is None or len(value) == 0:
            if allow_empty_option:
                return ""
            else:
                return default
        else:
            return value
    except ConfigParser.NoSectionError:
        return default
254954
def get_main_section(self, linesep=None):
        

        linesep = linesep or self.linesep or os.linesep

        stream = BytesIO()
        ManifestSection.store(self, stream, linesep)
        return stream.getvalue()
580845
def _get_section(self, name, type):
        
        for section in self.sections:
            if section['name'] == name and section['type'] == type:
                return section
        return None
632355
def section(request):
    
    # If SECTIONS setting is not specified, don't do anything.
    try:
        sections = settings.SECTIONS
    except AttributeError:
        return {}

    # Default return is first section.
    section = sections[0]['name']

    try:
        pattern_name = resolve_to_name(request.path_info)
    except Resolver404:
        pattern_name = None

    if pattern_name:
        for option in settings.SECTIONS:
            if pattern_name in option['matching_pattern_names']:
                section = option['name']

    return {'section': section}
410700
JournalSegment<E> getFirstSegment() {
    assertOpen();
    Map.Entry<Long, JournalSegment<E>> segment = segments.firstEntry();
    return segment != null ? segment.getValue() : null;
  }
651915
def get_default(parser, section, option, default):
    """"""
    try:
        result = parser.get(section, option)
    except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
        result = default
    return result
969003
def _find_sections(self, name_type_pairs):
        """"""
        sections = [None] * len(name_type_pairs)
        for section in self.elf.sections:
            section_name = to_str_safe(section.name)
            section_type = section.type
            for i, name_and_type in enumerate(name_type_pairs):
                if name_and_type != (section_name, section_type):
                    continue
                if sections[i] is not None:
                    raise FlashAlgoException("Elf contains duplicate section %s attr %s" %
                                    (section_name, section_type))
                sections[i] = section
        return sections
130841
def get(self, section, option, default = None):
  """"""
  if self.has_section(section):
   try:
    return self.config[section][option].get('value', None)
   except KeyError:
    if default == None:
     raise NoOptionError(option)
    else:
     return default
  else:
   raise NoSectionError(section)
1265852
def get_sections(self, hdrgo, dflt_section=True):
        """"""
        dflt_list = []
        # If the hdrgo is not in a section, return the default name for a section
        if dflt_section:
            dflt_list = [self.secdflt]
        return self.hdrgo2sections.get(hdrgo, dflt_list)
688076
def sections(self):
    """"""
    if not self._is_parsed:
      self._Parse()
      self._is_parsed = True

    return self._sections