def get_function_signature(func):
if func is None:<EOL><INDENT>return '<STR_LIT>'<EOL><DEDENT>try:<EOL><INDENT>func_name = func.__name__<EOL><DEDENT>except AttributeError:<EOL><INDENT>func_name = '<STR_LIT:None>'<EOL><DEDENT>if not inspect.isfunction(func):<EOL><INDENT>raise TypeError('<STR_LIT>' % (func_name, type(func)))<EOL><DEDENT>return func_name + str(inspect.signature(func))<EOL>
Return the signature string of the specified function.

>>> def foo(name): pass
>>> get_function_signature(foo)
'foo(name)'
>>> something = 'Hello'
>>> get_function_signature(something)
Traceback (most recent call last):
    ...
TypeError: The argument must be a function object: None type is <class 'str'>