def split_arguments(args):
    """Returns the 2-tuple (args[:-1], args[-1]) if args[-1] exists and
    is a dict; otherwise returns (args, {}).
    """
    if args and isinstance(args[-1], dict):
        return args[:-1], args[-1]
    else:
        return args, {}