def parse_args(self, args):
state = ParsingState(args)<EOL>try:<EOL><INDENT>self._process_args_for_options(state)<EOL>self._process_args_for_args(state)<EOL><DEDENT>except UsageError:<EOL><INDENT>if self.ctx is None or not self.ctx.resilient_parsing:<EOL><INDENT>raise<EOL><DEDENT><DEDENT>return state.opts, state.largs, state.order<EOL>
Parses positional arguments and returns ``(values, args, order)``
        for the parsed options and arguments as well as the leftover
        arguments if there are any.  The order is a list of objects as they
        appear on the command line.  If arguments appear multiple times they
        will be memorized multiple times as well.