! @brief Return a list of sections the same length and order of the input list
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
789556
def section_lengths(neurites, neurite_type=NeuriteType.all):
    ''''''
    return map_sections(_section_length, neurites, neurite_type=neurite_type)
285662
private function find_sections() {
    $sections = array();
    $level_memory = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
    $last_section = FALSE;

    // Match multiline comments
    preg_match_all('#\/\*((?:(?!\*\/).)*)\*\/#s', $this->code, $matches);

    foreach ($matches[1] as $match) {
      $section = array();
      $elements = $this->parse_match($match);

      if (isset($elements['title']) && isset($elements['level'])) {
        // Default htag to the lowest level htag
        $elements['htag'] = 'h6';

        // Find the depth of the level value
        $level_depth_arr = array_filter(explode('.', $elements['level']));
        $level_depth = count($level_depth_arr);
        if (isset($this->section_htags[$level_depth])) {
          $elements['htag'] = $this->section_htags[$level_depth];
        }

        // Reset the level memory to the depth of sub levels
        $level_memory = array_slice($level_memory, 0, $level_depth);
        $level_memory = array_pad($level_memory, 10, 0);

        // Set / unset and count up the levels
        foreach ($level_depth_arr as $key => $level) {
          if (is_numeric($level)) {
            $level_memory[$key] = $level;
          }
          else {
            // Only count up the last level
            if ($key > 0 && $key + 1 == $level_depth) {
              $level_memory[$key]++;
            }
            // Set the level depth
            $level_depth_arr[$key] = $level_memory[$key];
          }
        }
        $elements['level'] = implode('.', $level_depth_arr) . '.';

        $sections[$elements['level']] = $elements;
        $last_section = $elements['level'];
      }
      // If no title or level is provided scan for other styleguide elements
      // and append them to the previous section
      else if (!empty($elements)) {
        foreach ($elements as $element_label => $element_value) {
          $sections[$last_section][$element_label] = isset($sections[$last_section][$element_label])
            ? $sections[$last_section][$element_label] . "\n" . $element_value
            : $element_value;
        }
      }
    }

    ksort($sections);
    $this->build_section_tree($sections);
  }
454804
def sections(self):
        
        sections = []

        for match in texutils.section_pattern.finditer(self.text):
            textbefore = self.text[0:match.start()]
            wordsbefore = nlputils.wordify(textbefore)
            numwordsbefore = len(wordsbefore)
            sections.append((numwordsbefore, match.group(1)))

        self._sections = sections
        return sections
1343171
def _encode_wiki_sections(sections, vocab):
  """"""
  ids = []
  section_boundaries = []
  for i, section in enumerate(sections):
    if i > 0:
      # Skip including article title
      ids.extend(vocab.encode(_format_title(_normalize_text(section.title))))
    ids.extend(vocab.encode(_normalize_text(section.text)))
    section_boundaries.append(len(ids))

  return ids, section_boundaries
38223
def list_sections(self):
        """"""
        if not os.path.exists(self._full_base):
            return []
        return [
            name for name in os.listdir(self._full_base)
            if os.path.isdir(os.path.join(self._full_base, name))
        ]
442472
def get_sections(self, section_name):
        
        sections = []
        for timer in self.timers():
            for sect in timer.sections:
                if sect.name == section_name:
                    sections.append(sect)
                    break
            else:
                sections.append(AbinitTimerSection.fake())

        return sections
173800
def get_sections_flattened(section_nts):
        """"""
        nt_flds = list(section_nts[0][1][0]._fields)
        # Flatten section_nts 2-D list
        if 'section' in nt_flds:
            return [nt for _, nts in section_nts for nt in nts]
        # Flatten section_nts 2-D list, and add sections to each namedtuple
        nt_flds.append('section')
        nts_flat = []
        ntobj = cx.namedtuple("Nt", " ".join(nt_flds))
        for section_name, nts in section_nts:
            for nt_go in nts:
                vals = list(nt_go) + [section_name]
                nts_flat.append(ntobj._make(vals))
        return nts_flat
446825
def input(self):
        
        lst = [s.aesthetics for s in self]
        return list(itertools.chain(*lst))
593123
def InputRNAStructure(seq_length, name=None, **kwargs):
    
    return Input((seq_length, len(RNAplfold_PROFILES)), name=name, **kwargs)
966894
def translate_section(data):
    
    sect_str = ""
    elements = data.get("Elements", [])
    for elem in elements:
            print("    Translating " + elem["Type"])
            sect_str += translate_map[elem["Type"]](elem)
    return sect_str
1329160
def tokenlist(item, sep, suppress=True):
    """"""
    if suppress:
        sep = sep.suppress()
    return item + ZeroOrMore(sep + item) + Optional(sep)
134115
def list_input(*args, **kwargs):
    '''
    
    '''
    list_input = wtforms.TextAreaField(*args, **kwargs)
    list_input.input_type = 'list'
    return list_input
642557
def per_section(it, is_delimiter=lambda x: x.isspace()):
    
    ret = []
    for line in it:
        if is_delimiter(line):
            if ret:
                yield ret  # OR  ''.join(ret)
                ret = []
        else:
            ret.append(line.rstrip())  # OR  ret.append(line)
    if ret:
        yield ret
11524
def section_bif_lengths(neurites, neurite_type=NeuriteType.all):
    ''''''
    return map_sections(_section_length, neurites, neurite_type=neurite_type,
                        iterator_type=Tree.ibifurcation_point)
867176
def sections
      extracted_sections = []

      unless self.qp_sections.nil?
        self.qp_sections.each do |section|   
          extracted_sections.push(Section.new(section))
        end           
      end

      return extracted_sections
    end
531233
function (list) {
		var items = [];
		var i = 0;
		var listLength = list.length;

		for (; i < listLength; i++) {
			items.push(list[i]);
		}

		return items;
	}