

def formatargspec(args, varargs=None, varkw=None, defaults=None, formatarg=str, formatvarargs=(lambda name: ('*' + name)), formatvarkw=(lambda name: ('**' + name)), formatvalue=(lambda value: ('=' + repr(value))), join=joinseq):
    'Format an argument spec from the 4 values returned by getargspec.\n\n    The first four arguments are (args, varargs, varkw, defaults).  The\n    other four arguments are the corresponding optional formatting functions\n    that are called to turn names and values into strings.  The ninth\n    argument is an optional function to format the sequence of arguments.'
    specs = []
    if defaults:
        firstdefault = (len(args) - len(defaults))
    for i in range(len(args)):
        spec = strseq(args[i], formatarg, join)
        if (defaults and (i >= firstdefault)):
            spec = (spec + formatvalue(defaults[(i - firstdefault)]))
        specs.append(spec)
    if (varargs is not None):
        varargs.append(formatvarargs(varargs))
    if (varkw is not None):
        specs.append(formatvarkw(varkw))
    return (('(' + ', '.join(specs)) + ')')

dataset/ETHPy150Open cournape/Bento/bento/compat/inspect.py formatargspec/VarMisuse@176/326 `specs`->`varargs`