def isunary(f):
    """ Does a function have only a single argument?

    >>> def f(x):
    ...     return x

    >>> isunary(f)
    True
    >>> isunary(lambda x, y: x + y)
    False
    """
    try:
        if sys.version_info[0] == 2:  # pragma: py3 no cover
            spec = inspect.getargspec(f)
        if sys.version_info[0] == 3:  # pragma: py2 no cover
            spec = inspect.getfullargspec(f)
        return bool(spec and spec.varargs is None and not has_kwargs(f)
                    and len(spec.args) == 1)
    except __HOLE__:  # pragma: no cover
        return None    # in Python < 3.4 builtins fail, return None
dataset/ETHPy150Open pytoolz/toolz/toolz/functoolz.py/isunary