code: def inspect_signature(obj):
      """
      Custom signature inspection primarily for cython generated callables.
  
      Cython puts the signatures to the first line of the docstrings, which we
      can reuse to parse the python signature from, but some gymnastics are
      required, like removing the cython typehints.
  
      It converts the cython signature:
          array(obj, type=None, mask=None, size=None, from_pandas=None,
                bool safe=True, MemoryPool memory_pool=None)
      To:
          <Signature (obj, type=None, mask=None, size=None, from_pandas=None,
                      safe=True, memory_pool=None)>
      """
      cython_signature = obj.__doc__.splitlines()[0]
      cython_tokens = _tokenize_signature(cython_signature)
      python_tokens = _convert_typehint(cython_tokens)
      python_signature = tokenize.untokenize(python_tokens)
      return inspect._signature_fromstr(
          inspect.Signature, obj, python_signature
      )
  
imports: from contextlib import contextmanager
  from enum import EnumMeta
  import inspect
  import tokenize
  from ..compat import _get_module
  from ..utils.logger import logger
  from ..utils.command import Command, capture_stdout, default_bin
label_desc: Use image node_id 3 for calling a global function with example usage: inspect_signature(obj) and returns: inspect