class_docstr: Structured parse results, to provide multiple means of access to
  the parsed data:
  
  - as a list (``len(results)``)
  - by list index (``results[0], results[1]``, etc.)
  - by attribute (``results.<results_name>`` - see :class:`ParserElement.set_results_name`)
  
  Example::
  
      integer = Word(nums)
      date_str = (integer.set_results_name("year") + '/'
                  + integer.set_results_name("month") + '/'
                  + integer.set_results_name("day"))
      # equivalent form:
      # date_str = (integer("year") + '/'
      #             + integer("month") + '/'
      #             + integer("day"))
  
      # parse_string returns a ParseResults object
      result = date_str.parse_string("1999/12/31")
  
      def test(s, fn=repr):
          print(f"{s} -> {fn(eval(s))}")
      test("list(result)")
      test("result[0]")
      test("result['month']")
      test("result.day")
      test("'month' in result")
      test("'minutes' in result")
      test("result.dump()", str)
  
  prints::
  
      list(result) -> ['1999', '/', '12', '/', '31']
      result[0] -> '1999'
      result['month'] -> '12'
      result.day -> '31'
      'month' in result -> True
      'minutes' in result -> False
      result.dump() -> ['1999', '/', '12', '/', '31']
      - day: '31'
      - month: '12'
      - year: '1999'
class_docstr_tok: ["Structured","parse","results",",","to","provide","multiple","means","of","access","to","the","parsed","data",":","-","as","a","list","(","``","len","(","results",")","``",")","-","by","list","index","(","``","results","[","0","]",",","results","[","1","]","``",",","etc",".",")","-","by","attribute","(","``","results.","<","results_name",">","``","-","see",":","class",":","`","ParserElement.set_results_name","`",")","Example",":",":","integer","=","Word","(","nums",")","date_str","=","(","integer.set_results_name","(","``","year","''",")","+","'\/'","+","integer.set_results_name","(","``","month","''",")","+","'\/'","+","integer.set_results_name","(","``","day","''",")",")","#","equivalent","form",":","#","date_str","=","(","integer","(","``","year","''",")","+","'\/'","#","+","integer","(","``","month","''",")","+","'\/'","#","+","integer","(","``","day","''",")",")","#","parse_string","returns","a","ParseResults","object","result","=","date_str.parse_string","(","``","1999\/12\/31","''",")","def","test","(","s",",","fn=repr",")",":","print","(","f","''","{","s","}","-",">","{","fn","(","eval","(","s",")",")","}","''",")","test","(","``","list","(","result",")","''",")","test","(","``","result","[","0","]","''",")","test","(","``","result","[","'month","'","]","''",")","test","(","``","result.day","''",")","test","(","``","'month","'","in","result","''",")","test","(","``","'minutes","'","in","result","''",")","test","(","``","result.dump","(",")","''",",","str",")","prints",":",":","list","(","result",")","-",">","[","'1999","'",",","'\/","'",",","'12","'",",","'\/","'",",","'31","'","]","result","[","0","]","-",">","'1999'","result","[","'month","'","]","-",">","'12'","result.day","-",">","'31'","'month","'","in","result","-",">","True","'minutes","'","in","result","-",">","False","result.dump","(",")","-",">","[","'1999","'",",","'\/","'",",","'12","'",",","'\/","'",",","'31","'","]","-","day",":","'31'","-","month",":","'12'","-","year",":","'1999","'"]
docstr: Removes and returns item at specified index (default= ``last``).
  Supports both ``list`` and ``dict`` semantics for ``pop()``. If
  passed no argument or an integer argument, it will use ``list``
  semantics and pop tokens from the list of parsed tokens. If passed
  a non-integer argument (most likely a string), it will use ``dict``
  semantics and pop the corresponding value from any defined results
  names. A second default return value argument is supported, just as in
  ``dict.pop()``.
  
  Example::
  
      numlist = Word(nums)[...]
      print(numlist.parse_string("0 123 321")) # -> ['0', '123', '321']
  
      def remove_first(tokens):
          tokens.pop(0)
      numlist.add_parse_action(remove_first)
      print(numlist.parse_string("0 123 321")) # -> ['123', '321']
  
      label = Word(alphas)
      patt = label("LABEL") + Word(nums)[1, ...]
      print(patt.parse_string("AAB 123 321").dump())
  
      # Use pop() in a parse action to remove named result (note that corresponding value is not
      # removed from list form of results)
      def remove_LABEL(tokens):
          tokens.pop("LABEL")
          return tokens
      patt.add_parse_action(remove_LABEL)
      print(patt.parse_string("AAB 123 321").dump())
  
  prints::
  
      ['AAB', '123', '321']
      - LABEL: 'AAB'
  
      ['AAB', '123', '321']
docstr_tok: ["Removes","and","returns","item","at","specified","index","(","default=","``","last","``",")",".","Supports","both","``","list","``","and","``","dict","``","semantics","for","``","pop","(",")","``",".","If","passed","no","argument","or","an","integer","argument",",","it","will","use","``","list","``","semantics","and","pop","tokens","from","the","list","of","parsed","tokens",".","If","passed","a","non-integer","argument","(","most","likely","a","string",")",",","it","will","use","``","dict","``","semantics","and","pop","the","corresponding","value","from","any","defined","results","names",".","A","second","default","return","value","argument","is","supported",",","just","as","in","``","dict.pop","(",")","``",".","Example",":",":","numlist","=","Word","(","nums",")","[","...","]","print","(","numlist.parse_string","(","``","0","123","321","''",")",")","#","-",">","[","'","0","'",",","'123","'",",","'321","'","]","def","remove_first","(","tokens",")",":","tokens.pop","(","0",")","numlist.add_parse_action","(","remove_first",")","print","(","numlist.parse_string","(","``","0","123","321","''",")",")","#","-",">","[","'123","'",",","'321","'","]","label","=","Word","(","alphas",")","patt","=","label","(","``","LABEL","''",")","+","Word","(","nums",")","[","1",",","...","]","print","(","patt.parse_string","(","``","AAB","123","321","''",")",".dump","(",")",")","#","Use","pop","(",")","in","a","parse","action","to","remove","named","result","(","note","that","corresponding","value","is","not","#","removed","from","list","form","of","results",")","def","remove_LABEL","(","tokens",")",":","tokens.pop","(","``","LABEL","''",")","return","tokens","patt.add_parse_action","(","remove_LABEL",")","print","(","patt.parse_string","(","``","AAB","123","321","''",")",".dump","(",")",")","prints",":",":","[","'AAB","'",",","'123","'",",","'321","'","]","-","LABEL",":","'AAB'","[","'AAB","'",",","'123","'",",","'321","'","]"]
code: def pop(self, *args, **kwargs):
      """
      Removes and returns item at specified index (default= ``last``).
      Supports both ``list`` and ``dict`` semantics for ``pop()``. If
      passed no argument or an integer argument, it will use ``list``
      semantics and pop tokens from the list of parsed tokens. If passed
      a non-integer argument (most likely a string), it will use ``dict``
      semantics and pop the corresponding value from any defined results
      names. A second default return value argument is supported, just as in
      ``dict.pop()``.
  
      Example::
  
          numlist = Word(nums)[...]
          print(numlist.parse_string("0 123 321")) # -> ['0', '123', '321']
  
          def remove_first(tokens):
              tokens.pop(0)
          numlist.add_parse_action(remove_first)
          print(numlist.parse_string("0 123 321")) # -> ['123', '321']
  
          label = Word(alphas)
          patt = label("LABEL") + Word(nums)[1, ...]
          print(patt.parse_string("AAB 123 321").dump())
  
          # Use pop() in a parse action to remove named result (note that corresponding value is not
          # removed from list form of results)
          def remove_LABEL(tokens):
              tokens.pop("LABEL")
              return tokens
          patt.add_parse_action(remove_LABEL)
          print(patt.parse_string("AAB 123 321").dump())
  
      prints::
  
          ['AAB', '123', '321']
          - LABEL: 'AAB'
  
          ['AAB', '123', '321']
      """
      if not args:
          args = [-1]
      for k, v in kwargs.items():
          if k == "default":
              args = (args[0], v)
          else:
              raise TypeError(
                  f"pop() got an unexpected keyword argument {k!r}"
              )
      if isinstance(args[0], int) or len(args) == 1 or args[0] in self:
          index = args[0]
          ret = self[index]
          del self[index]
          return ret
      else:
          defaultvalue = args[1]
          return defaultvalue
  
imports: from collections.abc import MutableMapping, Mapping, MutableSequence, Iterator, Sequence, Container
  import pprint
  from typing import Tuple, Any, Dict, Set, List
label_desc: Use image node_id 15 for calling the ParseResults obj's underlying member method code with example usage: obj.pop() and returns: ret, defaultvalue