def format_function_signature(func):
 signature = get_function_signature(func)
 args_text = []
 for arg_name in signature['arg_names']:
  if (arg_name in signature['arg_defaults']):
   arg_default = signature['arg_defaults'][arg_name]
   arg_text_template = '%(arg_name)s=%(arg_default)r'
  else:
   arg_text_template = '%(arg_name)s'
  args_text.append((arg_text_template % vars()))
 if ('var_args' in signature):
  args_text.append(('*%(var_args)s' % signature))
 if ('var_kw_args' in signature):
  args_text.append(('**%(var_kw_args)s' % signature))
 signature_args_text = ', '.join(args_text)
 func_name = signature['name']
 signature_text = ('%(func_name)s(%(signature_args_text)s)' % vars())
 return signature_text

def format_function_signature ( func ) : signature = get_function_signature ( func ) args_text = [ ] for arg_name in signature [ 'arg_names' ] : if ( arg_name in signature [ 'arg_defaults' ] ) : arg_default = signature [ 'arg_defaults' ] [ arg_name ] arg_text_template = '%(arg_name)s=%(arg_default)r' else : arg_text_template = '%(arg_name)s' args_text . append ( ( arg_text_template % vars ( ) ) ) if ( 'var_args' in signature ) : args_text . append ( ( '*%(var_args)s' % signature ) ) if ( 'var_kw_args' in signature ) : args_text . append ( ( '**%(var_kw_args)s' % signature ) ) signature_args_text = ', ' . join ( args_text ) func_name = signature [ 'name' ] signature_text = ( '%(func_name)s(%(signature_args_text)s)' % vars ( ) ) return signature_text
format the function signature as printable text .