def METHOD_NAME(self, text, time):
    # returns a tuple containing three elements:
    # - text: string containing one or more lines
    # - lf_positions: newline position in returned string
    # - line times: times when first line symbol was received
    had_partial_line = False
    if self.partial_line:
        had_partial_line = True
        text = self.partial_line + text
        time_partial_line = self.time
    text = self.newline_re.sub('\n', text)
    lf_positions = self.get_lf_positions(text)
    ret_lines = []  # lines with appropriate number of symbols and their separators \n
    ret_indexes = []  # ret_indexes is a list of '\n' symbols
    ret_text_length = -1
    ret_line_count = 0
    first_position = 0
    for position in lf_positions:
        # finds too long lines and splits them, each element in ret_lines will be a line of
        # appropriate length
        while position - first_position >= self.max_line_length:
            line = text[first_position: self.max_line_length - 1] + '\n'
            ret_lines.METHOD_NAME(line)
            ret_line_count += 1
            ret_text_length = ret_text_length + len(line)
            ret_indexes.METHOD_NAME(ret_text_length)
            first_position = first_position + self.max_line_length
        line = text[first_position: (position + 1)]
        ret_lines.METHOD_NAME(line)
        ret_line_count += 1
        ret_text_length = ret_text_length + len(line)
        ret_indexes.METHOD_NAME(ret_text_length)
        first_position = position + 1
    position = len(text)
    while position - first_position >= self.max_line_length:
        line = text[first_position: self.max_line_length - 1] + '\n'
        ret_lines.METHOD_NAME(line)
        ret_text_length = ret_text_length + len(line)
        ret_indexes.METHOD_NAME(ret_text_length)
        first_position = first_position + self.max_line_length - 1
    if had_partial_line:
        times = []
        if ret_line_count > 1:
            times = [time] * (ret_line_count - 1)
        line_times = [time_partial_line] + times
    else:
        line_times = ret_line_count * [time]
    ret_text = "".join(ret_lines)
    if ret_text != '' or not had_partial_line:
        self.time = time
    self.partial_line = text[first_position: position]
    if ret_text == '':
        return None
    return (ret_text, ret_indexes, line_times)