<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _parseSections(self, data, imageDosHeader, imageNtHeaders, parse_header_only=False):
 """Parses the sections in the memory and returns a list of them"""

        sections = []

        optional_header_offset = imageDosHeader.header.e_lfanew + 4 + sizeof(IMAGE_FILE_HEADER)
        offset = optional_header_offset + imageNtHeaders.header.FileHeader.SizeOfOptionalHeader  # start reading behind the dos- and ntheaders

        image_section_header_size = sizeof(IMAGE_SECTION_HEADER)

        for sectionNo in range(imageNtHeaders.header.FileHeader.NumberOfSections):
            ishdr = IMAGE_SECTION_HEADER.from_buffer(data, offset)

            if parse_header_only:
                raw = None
                bytes_ = bytearray()
            else:
                size = ishdr.SizeOfRawData
                raw = (c_ubyte * size).from_buffer(data, ishdr.PointerToRawData)
                bytes_ = bytearray(raw)

            sections.append(SectionData(header=ishdr, name=ishdr.Name.decode('ASCII', errors='ignore'), bytes=bytes_, raw=raw))

            offset += image_section_header_size

        return sections