code: def test_varnames_decorator() -> None:
      F = TypeVar("F", bound=Callable[..., Any])
  
      def my_decorator(func: F) -> F:
          @wraps(func)
          def wrapper(*args, **kwargs):
              return func(*args, **kwargs)
  
          return cast(F, wrapper)
  
      @my_decorator
      def example(a, b=123) -> None:
          pass
  
      class Example:
          @my_decorator
          def example_method(self, x, y=1) -> None:
              pass
  
      ex_inst = Example()
  
      assert varnames(example) == (("a",), ("b",))
      assert varnames(Example.example_method) == (("x",), ("y",))
      assert varnames(ex_inst.example_method) == (("x",), ("y",))
  
file_path: catboost/contrib/python/pluggy/py3/tests/test_helpers.py
imports: from functools import wraps
  from typing import Any
  from typing import Callable
  from typing import cast
  from typing import TypeVar
  from pluggy._hooks import varnames
  from pluggy._manager import _formatdef
label_desc: Use image node_id 6 for calling a global function with example usage: test_varnames_decorator() and returns: cast, func