#NEWLINE# def has_kwargs( f ) : #NEWLINE# #INDENT# ' Does a function have keyword arguments?\n\n    >>> def f(x, y=0):\n    ...     return x + y\n\n    >>> has_kwargs(f)\n    True\n    ' #NEWLINE# if ( sys . version_info [ 0 ] == 2 ) : #NEWLINE# #INDENT# spec = inspect . getargspec ( spec ) #NEWLINE# return bool ( ( spec and ( spec . keywords or spec . defaults ) ) ) #NEWLINE# #UNINDENT# if ( sys . version_info [ 0 ] == 3 ) : #NEWLINE# #INDENT# spec = inspect . getfullargspec ( f ) #NEWLINE# return bool ( spec . defaults )