def _get_argspec(func):
if inspect.isclass(func):<EOL><INDENT>func = func.__init__<EOL><DEDENT>if not inspect.isfunction(func):<EOL><INDENT>return [], False<EOL><DEDENT>parameters = inspect.signature(func).parameters<EOL>args = []<EOL>uses_starstar = False<EOL>for par in parameters.values():<EOL><INDENT>if (par.kind == inspect.Parameter.POSITIONAL_OR_KEYWORD or<EOL>par.kind == inspect.Parameter.KEYWORD_ONLY):<EOL><INDENT>args.append(par.name)<EOL><DEDENT>elif par.kind == inspect.Parameter.VAR_KEYWORD:<EOL><INDENT>uses_starstar = True<EOL><DEDENT><DEDENT>return args, uses_starstar<EOL>
Helper function to support both Python versions