def args_and_keywords(function):
    """ Return the information about the function's argument signature.

        Return a list of the function's positional argument names and a
        dictionary containing the function's keyword arguments.

        Example:
            >>> import random
            >>> args, kw = args_and_keywords(random.triangular)
            >>> args
            ('self', 'low', 'high', 'mode')
            >>> sorted(kw.items())
            [('high', 1.0), ('low', 0.0), ('mode', None)]

    """
    arg_count = function.func_code.co_argcount
    arg_names = function.func_code.co_varnames[:arg_count]
    try:
        kw_arg_count = len(function.func_defaults)
        kw_names = arg_names[-kw_arg_count:]
        kw_dict = dict(zip(kw_names, function.func_defaults))
    except TypeError:
        kw_dict = {}
    return arg_names, kw_dict
