code: def test_decorated_function():
      """Test parsing of a simple function with a decorator."""
      parser = Parser()
      code = CodeSnippet(
          """\
          @single_decorator
          def do_something():
              \"""Do something.\"""
              return None
      """
      )
      module = parser.parse(code, "file_path")
      (function,) = module.children
      assert function.name == "do_something"
      assert len(function.decorators) == 1
      assert function.decorators[0].name == "single_decorator"
      assert function.children == []
      assert function.docstring == '"""Do something."""'
      assert function.kind == "function"
      assert function.parent == module
      assert function.start == 2
      assert function.end == 4
      assert function.source == textwrap.dedent(
          """\
          def do_something():
              \"""Do something.\"""
              return None
      """
      )
      assert function.is_public
      assert str(function) == "in public function `do_something`"
  
imports: import io
  import sys
  import pytest
  import textwrap
  from pathlib import Path
  from pydocstyle.parser import Parser, ParseError
label_desc: Use image node_id 4 for calling a global function with example usage: test_decorated_function() without return types