@classmethod
def _get_arguments(cls, data, max_args=-1):
    """Parse data into a list of arguments.

        Any un-parsed arguments (either because max was reached or because a
        delimiter was opened and not closed) will be returned as the last
        element of the resulting list.

        :param str data: The data to be broken down into arguments
        :param int max_args: The maximum number of arguments to parse,
                             if less than zero, all arguments are parsed
        :returns list: The parsed arguments

        """
    args = []
    while data and max_args != 0:
        arg, data = cls._one_argument(data)
        if arg:
            args.append(arg)
        if max_args > 0:
            max_args -= 1
    if data:
        args.append(data)
    return args
