code: def test_copy_function_doc_to_method_doc():
      """Test decorator for re-using function docstring as method docstrings."""
  
      def f1(object, a, b, c):
          """Docstring for f1.
  
          Parameters
          ----------
          object : object
              Some object. This description also has
  
              blank lines in it.
          a : int
              Parameter a
          b : int
              Parameter b
          """
          pass
  
      def f2(object):
          """Docstring for f2.
  
          Parameters
          ----------
          object : object
              Only one parameter
  
          Returns
          -------
          nothing.
          """
          pass
  
      def f3(object):
          """Docstring for f3.
  
          Parameters
          ----------
          object : object
              Only one parameter
          """
          pass
  
      def f4(object):
          """Docstring for f4."""
          pass
  
      def f5(object):  # noqa: D410, D411, D414
          """Docstring for f5.
  
          Parameters
          ----------
          Returns
          -------
          nothing.
          """
          pass
  
      class A:
          @copy_function_doc_to_method_doc(f1)
          def method_f1(self, a, b, c):
              pass
  
          @copy_function_doc_to_method_doc(f2)
          def method_f2(self):
              "method_f3 own docstring"
              pass
  
          @copy_function_doc_to_method_doc(f3)
          def method_f3(self):
              pass
  
      assert (
          A.method_f1.__doc__
          == """Docstring for f1.
  
          Parameters
          ----------
          a : int
              Parameter a
          b : int
              Parameter b
          """
      )
  
      assert (
          A.method_f2.__doc__
          == """Docstring for f2.
  
          Returns
          -------
          nothing.
          method_f3 own docstring"""
      )
  
      assert A.method_f3.__doc__ == "Docstring for f3.\n\n        "
      pytest.raises(
          ValueError, copy_function_doc_to_method_doc(f5), A.method_f1
      )
  
imports: import webbrowser
  import pytest
  from mne import grade_to_tris, open_docs
  from mne.utils import catch_logging, copy_doc, copy_function_doc_to_method_doc, deprecated, deprecated_alias, legacy, linkcode_resolve
label_desc: Use image node_id 7 for calling a global function with example usage: test_copy_function_doc_to_method_doc() without return types