code: def get_signature(
      target: Any,
      *,
      follow_wrapped: bool = True,
      eval_str: bool = False,
  ) -> inspect.Signature:
      # Special case for use of `@unittest.mock.patch` decorator, mimicking the
      # behaviour of getfullargspec instead of reporting unusable arguments.
      patches = getattr(target, "patchings", None)
      if isinstance(patches, list) and all(
          isinstance(p, PatchType) for p in patches
      ):
          P = inspect.Parameter
          return inspect.Signature(
              [
                  P("args", P.VAR_POSITIONAL),
                  P("keywargs", P.VAR_KEYWORD),
              ]
          )
  
      if isinstance(
          getattr(target, "__signature__", None), inspect.Signature
      ):
          # This special case covers unusual codegen like Pydantic models
          sig = target.__signature__
          check_signature(sig)
          # And *this* much more complicated block ignores the `self` argument
          # if that's been (incorrectly) included in the custom signature.
          if sig.parameters and (
              inspect.isclass(target) or inspect.ismethod(target)
          ):
              selfy = next(iter(sig.parameters.values()))
              if (
                  selfy.name == "self"
                  and selfy.default is inspect.Parameter.empty
                  and selfy.kind.name.startswith("POSITIONAL_")
              ):
                  return sig.replace(
                      parameters=[
                          v
                          for k, v in sig.parameters.items()
                          if k != "self"
                      ]
                  )
          return sig
      if sys.version_info[:2] <= (3, 8) and inspect.isclass(target):
          # Workaround for subclasses of typing.Generic on Python <= 3.8
          from hypothesis.strategies._internal.types import (
              is_generic_type,
          )
  
          if is_generic_type(target):
              sig = inspect.signature(target.__init__)
              check_signature(sig)
              return sig.replace(
                  parameters=[
                      v
                      for k, v in sig.parameters.items()
                      if k != "self"
                  ]
              )
      # eval_str is only supported by Python 3.10 and newer
      if sys.version_info[:2] >= (3, 10):
          sig = inspect.signature(
              target, follow_wrapped=follow_wrapped, eval_str=eval_str
          )
      else:
          sig = inspect.signature(
              target, follow_wrapped=follow_wrapped
          )  # pragma: no cover
      check_signature(sig)
      return sig
  
imports: import ast
  import hashlib
  import inspect
  import os
  import re
  import sys
  import textwrap
  import types
  from functools import wraps
  from io import StringIO
  from keyword import iskeyword
  from tokenize import COMMENT, detect_encoding, generate_tokens, untokenize
  from types import ModuleType
  from typing import TYPE_CHECKING, Any, Callable
  from unittest.mock import _patch
  from hypothesis.internal.compat import PYPY, is_typed_named_tuple
  from hypothesis.utils.conventions import not_set
  from hypothesis.vendor.pretty import pretty
label_desc: Use image node_id 5 for calling a global function with example usage: get_signature(target) and returns: sig, inspect, sig, sig, sig