def _add_notice_to_docstring(doc, no_doc_str, notice):
if not doc:<EOL><INDENT>lines = [no_doc_str]<EOL><DEDENT>else:<EOL><INDENT>lines = _normalize_docstring(doc).splitlines()<EOL><DEDENT>notice = ['<STR_LIT>'] + notice<EOL>if len(lines) > <NUM_LIT:1>:<EOL><INDENT>if lines[<NUM_LIT:1>].strip():<EOL><INDENT>notice.append('<STR_LIT>')<EOL><DEDENT>lines[<NUM_LIT:1>:<NUM_LIT:1>] = notice<EOL><DEDENT>else:<EOL><INDENT>lines += notice<EOL><DEDENT>return '<STR_LIT:\n>'.join(lines)<EOL>
Adds a deprecation notice to a docstring.