code: def _add_notice_to_docstring(doc, no_doc_str, notice):
      """Adds a deprecation notice to a docstring."""
      if not doc:
          lines = [no_doc_str]
  
      else:
          lines = _normalize_docstring(doc).splitlines()
  
      notice = [""] + notice
  
      if len(lines) > 1:
          # Make sure that we keep our distance from the main body
          if lines[1].strip():
              notice.append("")
  
          lines[1:1] = notice
      else:
          lines += notice
  
      return "\n".join(lines)
  
imports: import re
  import sys
label_desc: Use image node_id 5 for calling a global function with example usage: _add_notice_to_docstring(doc, no_doc_str, notice) and returns: str