code: def test__add_dep_doc():
      # Test utility function to add deprecation message to docstring
      assert _add_dep_doc("", "foo") == "foo\n"
      assert _add_dep_doc("bar", "foo") == "bar\n\nfoo\n"
      assert _add_dep_doc("   bar", "foo") == "   bar\n\nfoo\n"
      assert _add_dep_doc("   bar", "foo\n") == "   bar\n\nfoo\n"
      assert _add_dep_doc("bar\n\n", "foo") == "bar\n\nfoo\n"
      assert _add_dep_doc("bar\n    \n", "foo") == "bar\n\nfoo\n"
      assert (
          _add_dep_doc(" bar\n\nSome explanation", "foo\nbaz")
          == " bar\n\nfoo\nbaz\n\nSome explanation\n"
      )
      assert (
          _add_dep_doc(" bar\n\n  Some explanation", "foo\nbaz")
          == " bar\n  \n  foo\n  baz\n  \n  Some explanation\n"
      )
  
file_path: nibabel/nibabel/tests/test_deprecator.py
imports: import sys
  import warnings
  from functools import partial
  from textwrap import indent
  import pytest
  from nibabel.deprecator import TESTCLEANUP, TESTSETUP, Deprecator, ExpiredDeprecationError, _add_dep_doc, _ensure_cr
  from ..testing import clear_and_catch_warnings
label_desc: Use image node_id 2 for calling a global function with example usage: test__add_dep_doc() without return types