class_docstr: Dictionary that remembers insertion order
class_docstr_tok: ["Dictionary","that","remembers","insertion","order"]
docstr: od.popitem() -> (k, v), return and remove a (key, value) pair.
  Pairs are returned in LIFO order if last is true or FIFO order if false.
docstr_tok: ["od.popitem","(",")","-",">","(","k",",","v",")",",","return","and","remove","a","(","key",",","value",")","pair",".","Pairs","are","returned","in","LIFO","order","if","last","is","true","or","FIFO","order","if","false","."]
code: def popitem(self, last=True):
      """od.popitem() -> (k, v), return and remove a (key, value) pair.
      Pairs are returned in LIFO order if last is true or FIFO order if false.
  
      """
      if not self:
          raise KeyError("dictionary is empty")
      root = self.__root
      if last:
          link = root.prev
          link_prev = link.prev
          link_prev.next = root
          root.prev = link_prev
      else:
          link = root.next
          link_next = link.next
          root.next = link_next
          link_next.prev = root
      key = link.key
      del self.__map[key]
      value = dict.pop(self, key)
      return key, value
  
imports: from _functools import partial, reduce
  from collections import MutableMapping, namedtuple
  from .reprlib32 import recursive_repr
  from weakref import proxy
  import sys
label_desc: Use image node_id 7 for calling the OrderedDict obj's underlying member method code with example usage: obj.popitem(last) and returns: key,  value