code: def get_function_signature(function, method=True):
      wrapped = getattr(function, "_original_function", None)
      if wrapped is None:
          signature = inspect.getargspec(function)
      else:
          signature = inspect.getargspec(wrapped)
      defaults = signature.defaults
      if method:
          args = signature.args[1:]
      else:
          args = signature.args
      if defaults:
          kwargs = zip(args[-len(defaults) :], defaults)
          args = args[: -len(defaults)]
      else:
          kwargs = []
  
      signature = [
          f"{clean_module_name(function.__module__)}.{function.__name__}("
      ]
  
      for arg in args:
          signature.append(str(arg))
      for key, value in kwargs:
          if isinstance(value, str):
              value = f"'{value}'"
          signature.append(f"{key}={value}")
      return ", ".join(signature) + ")"
  
file_path: hyperopt/docs/autogen.py
imports: import re
  import inspect
  import os
  import shutil
label_desc: Use image node_id 1 for calling a global function with example usage: get_function_signature(function, method) and returns: unknown