code: def doc_unwrap(raw_doc):
      
      if raw_doc is None:
          return None
      docstring = ''
      consecutive_newlines = 0
      # Remove all leading and trailing whitespace in the documentation block
      for c in raw_doc.strip():
          if c == '\n':
              consecutive_newlines += 1
              if consecutive_newlines > 1:
                  docstring += c
          else:
              if consecutive_newlines == 1:
                  docstring += ' '
              consecutive_newlines = 0
              docstring += c
      return docstring
docs: Applies two transformations to raw_doc:
      1. N consecutive newlines are converted into N-1 newlines.
      2. A lone newline is converted to a space, which basically unwraps text.
  
      Returns a new string, or None if the input was None.