code: def getopt_with_ignore(args, shortopts, longopts=[]):
          
          opts = []
          prog_args = []
          if isinstance(longopts, str):
              longopts = [longopts]
          else:
              longopts = list(longopts)
          while args:
              if args[0] == '--':
                  prog_args += args[1:]
                  break
              if args[0].startswith('--'):
                  try:
                      opts, args = getopt.do_longs(
                          opts,
                          args[0][2:],
                          longopts,
                          args[1:]
                      )
                  except getopt.GetoptError:
                      args = args[1:]
              elif args[0][0] == '-':
                  try:
                      opts, args = getopt.do_shorts(
                          opts,
                          args[0][1:],
                          shortopts,
                          args[1:]
                      )
                  except getopt.GetoptError:
                      args = args[1:]
              else:
                  prog_args.append(args[0])
                  args = args[1:]
          return opts, prog_args
docs: my_getopt(args, options[, long_options]) -> opts, args
  
          This function works like gnu_getopt(), except that unknown parameters
          are ignored rather than raising an error.