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: Returns the results name for this token expression. Useful when several
  different expressions might match at a particular location.
  
  Example::
  
      integer = Word(nums)
      ssn_expr = Regex(r"\d\d\d-\d\d-\d\d\d\d")
      house_number_expr = Suppress('#') + Word(nums, alphanums)
      user_data = (Group(house_number_expr)("house_number")
                  | Group(ssn_expr)("ssn")
                  | Group(integer)("age"))
      user_info = user_data[1, ...]
  
      result = user_info.parse_string("22 111-22-3333 #221B")
      for item in result:
          print(item.get_name(), ':', item[0])
  
  prints::
  
      age : 22
      ssn : 111-22-3333
      house_number : 221B
docstr_tok: ["Returns","the","results","name","for","this","token","expression",".","Useful","when","several","different","expressions","might","match","at","a","particular","location",".","Example",":",":","integer","=","Word","(","nums",")","ssn_expr","=","Regex","(","r","''","\\d\\d\\d-\\d\\d-\\d\\d\\d\\d","''",")","house_number_expr","=","Suppress","(","'","#","'",")","+","Word","(","nums",",","alphanums",")","user_data","=","(","Group","(","house_number_expr",")","(","``","house_number","''",")","|","Group","(","ssn_expr",")","(","``","ssn","''",")","|","Group","(","integer",")","(","``","age","''",")",")","user_info","=","user_data","[","1",",","...","]","result","=","user_info.parse_string","(","``","22","111-22-3333","#","221B","''",")","for","item","in","result",":","print","(","item.get_name","(",")",",","'",":","'",",","item","[","0","]",")","prints",":",":","age",":","22","ssn",":","111-22-3333","house_number",":","221B"]
code: def get_name(self):
      r"""
      Returns the results name for this token expression. Useful when several
      different expressions might match at a particular location.
  
      Example::
  
          integer = Word(nums)
          ssn_expr = Regex(r"\d\d\d-\d\d-\d\d\d\d")
          house_number_expr = Suppress('#') + Word(nums, alphanums)
          user_data = (Group(house_number_expr)("house_number")
                      | Group(ssn_expr)("ssn")
                      | Group(integer)("age"))
          user_info = user_data[1, ...]
  
          result = user_info.parse_string("22 111-22-3333 #221B")
          for item in result:
              print(item.get_name(), ':', item[0])
  
      prints::
  
          age : 22
          ssn : 111-22-3333
          house_number : 221B
      """
      if self._name:
          return self._name
      elif self._parent:
          par: "ParseResults" = self._parent
          parent_tokdict_items = par._tokdict.items()
          return next(
              (
                  k
                  for k, vlist in parent_tokdict_items
                  for v, loc in vlist
                  if v is self
              ),
              None,
          )
      elif (
          len(self) == 1
          and len(self._tokdict) == 1
          and next(iter(self._tokdict.values()))[0][1] in (0, -1)
      ):
          return next(iter(self._tokdict.keys()))
      else:
          return None
  
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 32 for calling the ParseResults obj's underlying member method code with example usage: obj.get_name() and returns: self, next, next, None