class_docstr: The option parser is an internal class that is ultimately used to
  parse options and arguments.  It's modelled after optparse and brings
  a similar but vastly simplified API.  It should generally not be used
  directly as the high level Click classes wrap it for you.
  
  It's not nearly as extensible as optparse or argparse as it does not
  implement features that are implemented on a higher level (such as
  types or defaults).
  
  :param ctx: optionally the :class:`~click.Context` where this parser
              should go with.
class_docstr_tok: ["The","option","parser","is","an","internal","class","that","is","ultimately","used","to","parse","options","and","arguments",".","It","'s","modelled","after","optparse","and","brings","a","similar","but","vastly","simplified","API",".","It","should","generally","not","be","used","directly","as","the","high","level","Click","classes","wrap","it","for","you",".","It","'s","not","nearly","as","extensible","as","optparse","or","argparse","as","it","does","not","implement","features","that","are","implemented","on","a","higher","level","(","such","as","types","or","defaults",")",".",":","param","ctx",":","optionally","the",":","class",":","`","~click.Context","`","where","this","parser","should","go","with","."]
docstr: 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.
docstr_tok: ["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","."]
code: def parse_args(self, args):
      """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.
      """
      state = ParsingState(args)
      try:
          self._process_args_for_options(state)
          self._process_args_for_args(state)
      except UsageError:
          if self.ctx is None or not self.ctx.resilient_parsing:
              raise
      return state.opts, state.largs, state.order
  
imports: import re
  from collections import deque
  from .exceptions import BadArgumentUsage
  from .exceptions import BadOptionUsage
  from .exceptions import NoSuchOption
  from .exceptions import UsageError
label_desc: Use image node_id 4 for calling the OptionParser obj's underlying member method code with example usage: obj.parse_args(args) and returns: state,  state,  state