code: def optwrap(self, text):
          
          if not self.body_width:
              return text
  
          assert wrap, "Requires Python 2.3."
          result = ''
          newlines = 0
          for para in text.split("\n"):
              if len(para) > 0:
                  if not skipwrap(para):
                      result += "\n".join(wrap(para, self.body_width))
                      if para.endswith('  '):
                          result += "  \n"
                          newlines = 1
                      else:
                          result += "\n\n"
                          newlines = 2
                  else:
                      if not onlywhite(para):
                          result += para + "\n"
                          newlines = 1
              else:
                  if newlines < 2:
                      result += "\n"
                      newlines += 1
          return result
docs: Wrap all paragraphs in the provided text.