def format_arg_spec(metadata):
    """ 
    Return a string representing the arguments taken by the handler for the 
    given event.  This is meant to be used by the docstring formatters.
    """
    if metadata.arg_spec is None:
        return ''
    results = []
    arguments = metadata.arg_spec.args
    defaults = metadata.arg_spec.defaults
    varargs = metadata.arg_spec.varargs
    kwargs = metadata.arg_spec.keywords
    num_arguments = len(arguments)
    num_defaults = len(defaults) if defaults is not None else 0
    for index, argument in enumerate(arguments):
        if index == 0 and argument == 'self':
            continue
        default_index = index - num_arguments + num_defaults
        if default_index >= 0:
            argument += '={}'.format(defaults[default_index])
        results.append(argument)
    if varargs is not None:
        results.append('*' + varargs)
    if kwargs is not None:
        results.append('**' + kwargs)
    if results:
        return ' : ' + ', '.join(results)
    else:
        return ''
