code: def ismethod(func):
      """Is func a method?
  
      Note that this has to work as the method is defined but before the class is
      defined.  At this stage methods look like functions.
      """
      signature = inspect.signature(func)
      return signature.parameters.get("self", None) is not None
  
imports: from __future__ import annotations
  from typing import Any
  import inspect
  from .dispatcher import Dispatcher, MethodDispatcher, ambiguity_warn
label_desc: Use image node_id 2 for calling a global function with example usage: ismethod(func) and returns: unknown