code: def get_function_signature(fn, method=True):
      wrapped = getattr(fn, "_original_function", None)
      if wrapped is None:
          try:
              signature = inspect.getargspec(fn)
          except ValueError:
              signature = inspect.getfullargspec(fn)
      else:
          signature = inspect.getargspec(wrapped)
      if signature.defaults is None:
          signature = signature._replace(defaults=[])
      defaults = signature.defaults
      if hasattr(signature, "kwonlydefaults"):
          signature.args.extend(signature.kwonlyargs)
          for kwa in signature.kwonlyargs:
              defaults.append(signature.kwonlydefaults[kwa])
      if method:
          args = signature.args[1:]  # Remove self
      else:
          args = signature.args
      if defaults:
          kwargs = zip(args[-len(defaults) :], defaults)
          args = args[: -len(defaults)]
      else:
          kwargs = []
      st = "%s.%s(" % (clean_module_name(fn.__module__), fn.__name__)
  
      for a in args:
          st += str(a) + ", "
      for a, v in kwargs:
          if isinstance(v, str):
              v = "'" + v + "'"
          st += str(a) + "=" + str(v) + ", "
      if kwargs or args:
          signature = st[:-2] + ")"
      else:
          signature = st + ")"
      return post_process_signature(signature)
  
imports: from __future__ import print_function, unicode_literals
  import glob
  import inspect
  import os
  import re
  import shutil
  from spektral import data, datasets, layers, models, transforms, utils
label_desc: Use image node_id 1 for calling a global function with example usage: get_function_signature(fn, method) and returns: post_process_signature