pypet/utils/helpful_functions.py
def _get_argspec(func):
    """Helper function to support both Python versions"""
    if inspect.isclass(func):
        func = func.__init__
    if not inspect.isfunction(func):
        # Init function not existing
        return [], False
    parameters = inspect.signature(func).parameters
    args = []
    uses_starstar = False
    for par in parameters.values():
        if (par.kind == inspect.Parameter.POSITIONAL_OR_KEYWORD or
                    par.kind == inspect.Parameter.KEYWORD_ONLY):
            args.append(par.name)
        elif par.kind == inspect.Parameter.VAR_KEYWORD:
            uses_starstar = True
    return args, uses_starstar
def _get_argspec(func):
    if inspect.isclass(func):
        func = func.__init__
    if not inspect.isfunction(func):
        # Init function not existing
        return [], False
    parameters = inspect.signature(func).parameters
    args = []
    uses_starstar = False
    for par in parameters.values():
        if (par.kind == inspect.Parameter.POSITIONAL_OR_KEYWORD or
                    par.kind == inspect.Parameter.KEYWORD_ONLY):
            args.append(par.name)
        elif par.kind == inspect.Parameter.VAR_KEYWORD:
            uses_starstar = True
    return args, uses_starstar
def _get_argspec ( func ) : if inspect . isclass ( func ) : func = func . __init__ if not inspect . isfunction ( func ) : # Init function not existing return [ ] , False parameters = inspect . signature ( func ) . parameters args = [ ] uses_starstar = False for par in parameters . values ( ) : if ( par . kind == inspect . Parameter . POSITIONAL_OR_KEYWORD or par . kind == inspect . Parameter . KEYWORD_ONLY ) : args . append ( par . name ) elif par . kind == inspect . Parameter . VAR_KEYWORD : uses_starstar = True return args , uses_starstar
Helper function to support both Python versions
Helper function to support both Python versions