# Path: openformats/utils/newlines.py
# def find_newline_type(content):
#     if isinstance(content, six.text_type):
#         NEWLINE = "\n"
#         CARRIAGE_RETURN = "\r"
#     else:
#         NEWLINE = b"\n"
#         CARRIAGE_RETURN = b"\r"
# 
#     try:
#         first_newline_pos = content.index(NEWLINE)
#     except ValueError:
#         return 'UNIX'
#     else:
#         if (first_newline_pos > 0 and
#                 content[first_newline_pos - 1] == CARRIAGE_RETURN):
#             return 'DOS'
#         else:
#             return 'UNIX'
# 
# def force_newline_type(content, newline_type):
#     if isinstance(content, six.text_type):
#         NEWLINE = "\n"
#         CARRIAGE_RETURN_NEWLINE = "\r\n"
#     else:
#         NEWLINE = b"\n"
#         CARRIAGE_RETURN_NEWLINE = b"\r\n"
# 
#     new_content = content.replace(CARRIAGE_RETURN_NEWLINE, NEWLINE)
#     if newline_type == 'DOS':
#         new_content = new_content.replace(NEWLINE, CARRIAGE_RETURN_NEWLINE)
#     return new_content


import six
from .utils.newlines import find_newline_type, force_newline_type
        section_start_position = self._find_last_section_start(place)
        try:
            section_end_position = self.destination.index(
                self.SectionEnd, section_start_position
            )
        except ValueError:
            section_end_position = len(self.destination) - 1
        for i in six.moves.xrange(section_start_position,
                                  section_end_position + 1):
            self.destination[i] = None

    def _find_last_section_start(self, place=0):
        count = place
        for i, segment in enumerate(self.destination[::-1], start=1):
            if segment == self.SectionStart:
                if count == 0:
                    return len(self.destination) - i
                else:
                    count -= 1

    @property
    def line_number(self):
        r"""
        The transcriber remembers how many newlines it has went over on the
        source, both when copying and skipping content. This allows you to
        pinpoint the line-number a parse-error has occured. For example::

            source:
                first line
                second line

# Path: openformats/utils/newlines.py
# def find_newline_type(content):
#     if isinstance(content, six.text_type):
#         NEWLINE = "\n"
#         CARRIAGE_RETURN = "\r"
#     else:
#         NEWLINE = b"\n"
#         CARRIAGE_RETURN = b"\r"
# 
#     try:
#         first_newline_pos = content.index(NEWLINE)
#     except ValueError:
#         return 'UNIX'
#     else:
#         if (first_newline_pos > 0 and
#                 content[first_newline_pos - 1] == CARRIAGE_RETURN):
#             return 'DOS'
#         else:
#             return 'UNIX'
# 
# def force_newline_type(content, newline_type):
#     if isinstance(content, six.text_type):
#         NEWLINE = "\n"
#         CARRIAGE_RETURN_NEWLINE = "\r\n"
#     else:
#         NEWLINE = b"\n"
#         CARRIAGE_RETURN_NEWLINE = b"\r\n"
# 
#     new_content = content.replace(CARRIAGE_RETURN_NEWLINE, NEWLINE)
#     if newline_type == 'DOS':
#         new_content = new_content.replace(NEWLINE, CARRIAGE_RETURN_NEWLINE)
#     return new_content


# Path: openformats/transcribers.py
import six
from .utils.newlines import find_newline_type, force_newline_type

        section_start_position = self._find_last_section_start(place)
        try:
            section_end_position = self.destination.index(
                self.SectionEnd, section_start_position
            )
        except ValueError:
            section_end_position = len(self.destination) - 1
        for i in six.moves.xrange(section_start_position,
                                  section_end_position + 1):
            self.destination[i] = None

    def _find_last_section_start(self, place=0):
        count = place
        for i, segment in enumerate(self.destination[::-1], start=1):
            if segment == self.SectionStart:
                if count == 0:
                    return len(self.destination) - i
                else:
                    count -= 1

    @property
    def line_number(self):
        r"""
        The transcriber remembers how many newlines it has went over on the
        source, both when copying and skipping content. This allows you to
        pinpoint the line-number a parse-error has occured. For example::

            source:
                first line
                second line

                third line with error