sklearn/utils/_testing.py
def _get_args(function, varargs=False):
    """Helper to get function arguments."""

    try:
        params = signature(function).parameters
    except ValueError:
        # Error on builtin C function
        return []
    args = [key for key, param in params.items()
            if param.kind not in (param.VAR_POSITIONAL, param.VAR_KEYWORD)]
    if varargs:
        varargs = [param.name for param in params.values()
                   if param.kind == param.VAR_POSITIONAL]
        if len(varargs) == 0:
            varargs = None
        return args, varargs
    else:
        return args
Helper to get function arguments.
Helper to get function arguments.
Helper to get function arguments .
def _get_args(function, varargs=False):
    try:
        params = signature(function).parameters
    except ValueError:
        return []
    args = [key for key, param in params.items()
            if param.kind not in (param.VAR_POSITIONAL, param.VAR_KEYWORD)]
    if varargs:
        varargs = [param.name for param in params.values()
                   if param.kind == param.VAR_POSITIONAL]
        if len(varargs) == 0:
            varargs = None
        return args, varargs
    else:
        return args
def _get_args ( function , varargs = False ) : try : params = signature ( function ) . parameters except ValueError : return [ ] args = [ key for key , param in params . items ( ) if param . kind not in ( param . VAR_POSITIONAL , param . VAR_KEYWORD ) ] if varargs : varargs = [ param . name for param in params . values ( ) if param . kind == param . VAR_POSITIONAL ] if len ( varargs ) == 0 : varargs = None return args , varargs else : return args
Helper to get function arguments.
Helper to get function arguments .
"""Helper to get function arguments.""" # Error on builtin C function
function
varargs