class_docstr: Wrapper around the standard 'getopt()' module that provides some
  handy extra functionality:
    * short and long options are tied together
    * options have help strings, and help text can be assembled
      from them
    * options set attributes of a passed-in object
    * boolean options can have "negative aliases" -- eg. if
      --quiet is the "negative alias" of --verbose, then "--quiet"
      on the command line sets 'verbose' to false
docstr: Parse command-line options in args. Store as attributes on object.
  
  If 'args' is None or not supplied, uses 'sys.argv[1:]'.  If
  'object' is None or not supplied, creates a new OptionDummy
  object, stores option values there, and returns a tuple (args,
  object).  If 'object' is supplied, it is modified in place and
  'getopt()' just returns 'args'; in both cases, the returned
  'args' is a modified copy of the passed-in 'args' list, which
  is left untouched.
docstr_tok: ["Parse","command-line","options","in","args",".","Store","as","attributes","on","object",".","If","'args","'","is","None","or","not","supplied",",","uses","'sys.argv","[","1",":","]","'",".","If","'object","'","is","None","or","not","supplied",",","creates","a","new","OptionDummy","object",",","stores","option","values","there",",","and","returns","a","tuple","(","args",",","object",")",".","If","'object","'","is","supplied",",","it","is","modified","in","place","and","'getopt","(",")","'","just","returns","'args","'",";","in","both","cases",",","the","returned","'args","'","is","a","modified","copy","of","the","passed-in","'args","'","list",",","which","is","left","untouched","."]
code: def getopt(self, args=None, object=None):  # noqa: C901
      """Parse command-line options in args. Store as attributes on object.
  
      If 'args' is None or not supplied, uses 'sys.argv[1:]'.  If
      'object' is None or not supplied, creates a new OptionDummy
      object, stores option values there, and returns a tuple (args,
      object).  If 'object' is supplied, it is modified in place and
      'getopt()' just returns 'args'; in both cases, the returned
      'args' is a modified copy of the passed-in 'args' list, which
      is left untouched.
      """
      if args is None:
          args = sys.argv[1:]
      if object is None:
          object = OptionDummy()
          created_object = True
      else:
          created_object = False
  
      self._grok_option_table()
  
      short_opts = " ".join(self.short_opts)
      try:
          opts, args = getopt.getopt(args, short_opts, self.long_opts)
      except getopt.error as msg:
          raise DistutilsArgError(msg)
  
      for opt, val in opts:
          if len(opt) == 2 and opt[0] == "-":  # it's a short option
              opt = self.short2long[opt[1]]
          else:
              assert len(opt) > 2 and opt[:2] == "--"
              opt = opt[2:]
  
          alias = self.alias.get(opt)
          if alias:
              opt = alias
  
          if not self.takes_arg[opt]:  # boolean option?
              assert val == "", "boolean option can't have value"
              alias = self.negative_alias.get(opt)
              if alias:
                  opt = alias
                  val = 0
              else:
                  val = 1
  
          attr = self.attr_name[opt]
          # The only repeating option at the moment is 'verbose'.
          # It has a negative option -q quiet, which should set verbose = 0.
          if val and self.repeat.get(attr) is not None:
              val = getattr(object, attr, 0) + 1
          setattr(object, attr, val)
          self.option_order.append((opt, val))
  
      # for opts
      if created_object:
          return args, object
      else:
          return args
  
imports: import sys
  import string
  import re
  import getopt
  from .errors import DistutilsGetoptError, DistutilsArgError
label_desc: Use image node_id 11 for calling the FancyGetopt obj's underlying member method code with example usage: obj.getopt(args, object) and returns: args,  object, args