def _wrap_chunks(self, chunks):
lines = []<EOL>if self.width <= <NUM_LIT:0>:<EOL><INDENT>raise ValueError("<STR_LIT>" % self.width)<EOL><DEDENT>chunks.reverse()<EOL>while chunks:<EOL><INDENT>cur_line = []<EOL>cur_len = <NUM_LIT:0><EOL>if lines:<EOL><INDENT>indent = self.subsequent_indent<EOL><DEDENT>else:<EOL><INDENT>indent = self.initial_indent<EOL><DEDENT>width = self.width - len(indent)<EOL>if self.drop_whitespace and chunks[-<NUM_LIT:1>].strip() == '<STR_LIT>' and lines:<EOL><INDENT>chunks.pop()<EOL><DEDENT>while chunks:<EOL><INDENT>l = len(chunks[-<NUM_LIT:1>])<EOL>if cur_len + l <= width:<EOL><INDENT>cur_line.append(chunks.pop())<EOL>cur_len += l<EOL><DEDENT>else:<EOL><INDENT>break<EOL><DEDENT><DEDENT>if chunks and len(chunks[-<NUM_LIT:1>]) > width:<EOL><INDENT>self._handle_long_word(chunks, cur_line, cur_len, width)<EOL><DEDENT>if self.drop_whitespace and cur_line and cur_line[-<NUM_LIT:1>].strip() == '<STR_LIT>':<EOL><INDENT>cur_line.pop()<EOL><DEDENT>if cur_line:<EOL><INDENT>lines.append(indent + '<STR_LIT>'.join(cur_line))<EOL><DEDENT><DEDENT>return lines<EOL>
_wrap_chunks(chunks : [string]) -> [string]

        Wrap a sequence of text chunks and return a list of lines of
        length 'self.width' or less.  (If 'break_long_words' is false,
        some lines may be longer than this.)  Chunks correspond roughly
        to words and the whitespace between them: each chunk is
        indivisible (modulo 'break_long_words'), but a line break can
        come between any two chunks.  Chunks should not have internal
        whitespace; ie. a chunk is either all whitespace or a "word".
        Whitespace chunks will be removed from the beginning and end of
        lines, but apart from that whitespace is preserved.