code: def varnames(func: object) -> tuple[tuple[str, ...], tuple[str, ...]]:
      """Return tuple of positional and keywrord argument names for a function,
      method, class or callable.
  
      In case of a class, its ``__init__`` method is considered.
      For methods the ``self`` parameter is not included.
      """
      if inspect.isclass(func):
          try:
              func = func.__init__
          except AttributeError:
              return (), ()
      elif not inspect.isroutine(func):  # callable object?
          try:
              func = getattr(func, "__call__", func)
          except Exception:
              return (), ()
  
      try:
          # func MUST be a function or method here or we won't parse any args.
          sig = inspect.signature(
              func.__func__
              if inspect.ismethod(func)
              else func  # type:ignore[arg-type]
          )
      except TypeError:
          return (), ()
  
      _valid_param_kinds = (
          inspect.Parameter.POSITIONAL_ONLY,
          inspect.Parameter.POSITIONAL_OR_KEYWORD,
      )
      _valid_params = {
          name: param
          for name, param in sig.parameters.items()
          if param.kind in _valid_param_kinds
      }
      args = tuple(_valid_params)
      defaults = (
          tuple(
              param.default
              for param in _valid_params.values()
              if param.default is not param.empty
          )
          or None
      )
  
      if defaults:
          index = -len(defaults)
          args, kwargs = args[:index], tuple(args[index:])
      else:
          kwargs = ()
  
      # strip any implicit instance arg
      # pypy3 uses "obj" instead of "self" for default dunder methods
      if not _PYPY:
          implicit_names: tuple[str, ...] = ("self",)
      else:
          implicit_names = ("self", "obj")
      if args:
          qualname: str = getattr(func, "__qualname__", "")
          if inspect.ismethod(func) or (
              "." in qualname and args[0] in implicit_names
          ):
              args = args[1:]
  
      return args, kwargs
  
imports: from __future__ import annotations
  import inspect
  import sys
  import warnings
  from types import ModuleType
  from typing import AbstractSet
  from typing import Any
  from typing import Callable
  from typing import Final
  from typing import final
  from typing import Generator
  from typing import List
  from typing import Mapping
  from typing import Optional
  from typing import overload
  from typing import Sequence
  from typing import Tuple
  from typing import TYPE_CHECKING
  from typing import TypedDict
  from typing import TypeVar
  from typing import Union
  from ._result import Result
label_desc: Use image node_id 2 for calling a global function with example usage: varnames(func) and returns: args,  kwargs, ,  , ,  , ,  