Prints IMAGE_SECTION_HEADER for every section present in the file.
168247
def showSectionsHeaders(peInstance):
    
    
    print "[+] Sections information:\n"
    print "--> NumberOfSections: %d\n" % peInstance.ntHeaders.fileHeader.numberOfSections.value
    for section in peInstance.sectionHeaders:
        fields = section.getFields()
        for field in fields:
            if isinstance(fields[field],  datatypes.String):
                fmt = "%s = %s"
            else:
                fmt = "%s = 0x%08x"
            print fmt % (field,  fields[field].value)
        print "\n"
544961
private void drawPEHeaders() {
		long msdosOffset = 0;
		long msdosSize = withMinLength(data.getMSDOSHeader().getHeaderSize());
		drawPixels(colorMap.get(MSDOS_HEADER), msdosOffset, msdosSize);

		long optOffset = data.getOptionalHeader().getOffset();
		long optSize = withMinLength(data.getOptionalHeader().getSize());
		drawPixels(colorMap.get(OPTIONAL_HEADER), optOffset, optSize);

		long coffOffset = data.getCOFFFileHeader().getOffset();
		long coffSize = withMinLength(COFFFileHeader.HEADER_SIZE);
		drawPixels(colorMap.get(COFF_FILE_HEADER), coffOffset, coffSize);

		long tableOffset = data.getSectionTable().getOffset();
		long tableSize = data.getSectionTable().getSize();
		if (tableSize != 0) {
			tableSize = withMinLength(tableSize);
			drawPixels(colorMap.get(SECTION_TABLE), tableOffset, tableSize);
		}
	}
652683
def _write_header(self):
        """"""
        for line in self.header.lines:
            print(line.serialize(), file=self.stream)
        if self.header.samples.names:
            print(
                "\t".join(list(parser.REQUIRE_SAMPLE_HEADER) + self.header.samples.names),
                file=self.stream,
            )
        else:
            print("\t".join(parser.REQUIRE_NO_SAMPLE_HEADER), file=self.stream)
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
811661
def printheader(h=None):
    """"""
    writer = csv.writer(sys.stdout)
    writer.writerow(header_fields(h))
491013
def _parseSections(self, data, elfHeader):
        """"""
        offset = elfHeader.header.e_shoff
        shdrs = []
        for i in range(elfHeader.header.e_shnum):
            shdr = self.__classes.SHDR.from_buffer(data, offset)
            section_bytes = None
            ba_section_bytes = None
            if shdr.sh_type != SHT.NOBITS:
                section_bytes = (c_ubyte * shdr.sh_size).from_buffer(data, shdr.sh_offset)
                ba_section_bytes = bytearray(section_bytes)
            shdrs.append(ShdrData(name=None,header=shdr, raw=section_bytes, bytes=ba_section_bytes))
            offset += elfHeader.header.e_shentsize

        if elfHeader.header.e_shstrndx != SHN.UNDEF:
            strtab = shdrs[elfHeader.header.e_shstrndx]
            strtab_offset = strtab.header.sh_offset

            for section in shdrs:
                section.name = get_str(strtab.raw, section.header.sh_name)

        return shdrs
274875
def is_image_in_section?(section, image, count, flag=true)
      if flag
        assert page.has_selector?(:css,"#{section} img[src$='/assets/#{image}']", count: count), "Error: #{count} #{image}(s) not found in #{section} !"
      else
        assert !page.has_selector?(:css,"#{section} img[src$='/assets/#{image}']", count: count), "Error: #{count} #{image}(s) found in #{section} !"
      end
    end
1359277
def _write_section(self, fp, section_name, section_items, delimiter):
        """"""
        fp.write("[{0}]\n".format(section_name))
        for key, value in section_items:
            value = self._interpolation.before_write(self, section_name, key,
                                                     value)
            if value is not None or not self._allow_no_value:
                value = delimiter + str(value).replace('\n', '\n\t')
            else:
                value = ""
            fp.write("{0}{1}\n".format(key, value))
        fp.write("\n")
1358939
def print_header(self):
        """"""
        lines_to_print = []
        lines_to_print.append('##fileformat='+self.fileformat)
        if self.filedate:
            lines_to_print.append('##fileformat='+self.fileformat)
            
        for filt in self.filter_dict:
            lines_to_print.append(self.filter_dict[filt])
        for form in self.format_dict:
            lines_to_print.append(self.format_dict[form])
        for info in self.info_dict:
            lines_to_print.append(self.info_dict[info])
        for contig in self.contig_dict:
            lines_to_print.append(self.contig_dict[contig])
        for alt in self.alt_dict:
            lines_to_print.append(self.alt_dict[alt])
        for other in self.other_dict:
            lines_to_print.append(self.other_dict[other])
        lines_to_print.append('#'+ '\t'.join(self.header))
        return lines_to_print
323238
def print_header(text):
  """"""
  print()
  print('#'*(len(text)+4))
  print('# ' + text + ' #')
  print('#'*(len(text)+4))
  print()
999897
def image_section(image, title):
    
    # pull first image
    img = yield marv.pull(image)
    if img is None:
        return

    # create image widget and section containing it
    widget = {'title': image.title, 'image': {'src': img.relpath}}
    section = {'title': title, 'widgets': [widget]}
    yield marv.push(section)
959027
def write_header(self):
        
        self.fileobj.seek(0)
        header = mar_header.build(dict(index_offset=self.last_offset))
        self.fileobj.write(header)
853697
def print_info(self, buf=None):
        """"""
        buf = buf or sys.stdout
        print >> buf, "Sections:"
        for i, section in enumerate(self._sections):
            print >> buf, "  %s:\t%s (%s)" % (i + 1, section[0], section[1])
1321941
private function view_header() {
        global $OUTPUT;
        admin_externalpage_setup('manage' . $this->subtype . 'plugins');
        // Print the page heading.
        echo $OUTPUT->header();
        echo $OUTPUT->heading(get_string('manage' . $this->subtype . 'plugins', 'assign'));
    }
165671
def get_sections_2d(self):
        """"""
        sections_hdrgos_act = []
        hdrgos_act_all = self.get_hdrgos()  # Header GOs actually used to group
        hdrgos_act_secs = set()
        if self.hdrobj.sections:
            for section_name, hdrgos_all_lst in self.hdrobj.sections:
                # print("GGGGGGGGGGGGGGGGG {N:3} {NAME}".format(N=len(hdrgos_all_lst), NAME=section_name))
                hdrgos_all_set = set(hdrgos_all_lst)
                hdrgos_act_set = hdrgos_all_set.intersection(hdrgos_act_all)
                if hdrgos_act_set:
                    hdrgos_act_secs |= hdrgos_act_set
                    # Use original order of header GOs found in sections
                    hdrgos_act_lst = []
                    hdrgos_act_ctr = cx.Counter()
                    for hdrgo_p in hdrgos_all_lst: # Header GO that may or may not be used.
                        if hdrgo_p in hdrgos_act_set and hdrgos_act_ctr[hdrgo_p] == 0:
                            hdrgos_act_lst.append(hdrgo_p)
                        hdrgos_act_ctr[hdrgo_p] += 1
                    sections_hdrgos_act.append((section_name, hdrgos_act_lst))
            # print(">>>>>>>>>>>>>>> hdrgos_act_all {N:3}".format(N=len(hdrgos_act_all)))
            # print(">>>>>>>>>>>>>>> hdrgos_act_secs {N:3}".format(N=len(hdrgos_act_secs)))
            hdrgos_act_rem = hdrgos_act_all.difference(hdrgos_act_secs)
            if hdrgos_act_rem:
                # print("RRRRRRRRRRR {N:3}".format(N=len(hdrgos_act_rem)))
                sections_hdrgos_act.append((self.hdrobj.secdflt, hdrgos_act_rem))
        else:
            sections_hdrgos_act.append((self.hdrobj.secdflt, hdrgos_act_all))
        return sections_hdrgos_act
636634
public void printHtmlHeaderArea(PrintWriter out)
    {
        ClassInfoModel classInfo = ((HelpScreen)this.getScreenField()).getClassInfo();
        
        if (classInfo != null)
            if (classInfo.isValidRecord())
        {
            String strHeader =
    " <title>Technical Help Screen - " + Utility.encodeXML(classInfo.getClassDesc()) + " </title>" +
    //+"    <meta-keywords>" + Utility.encodeXML(m_classInfo.getField(ClassInfo.KEYWORDS).toString()) + "</meta-keywords>" +
    " <meta-description>" + Utility.encodeXML(classInfo.getClassExplain()) + "</meta-description>";
            out.println(strHeader);
        }
    }
1035910
def section(self, section):
        
        if isinstance(section, list):
            for h in section:
                self.add_section(h)
        else:
            self.add_section(section)