parameters: (self, last=True)
return_statement: return key, value
docstring: 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.
docstring_summary: 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.
docstring_tokens: 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 .
function: 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[0]
              link_prev = link[0]
              link_prev[1] = root
              root[0] = link_prev
          else:
              link = root[1]
              link_next = link[1]
              root[1] = link_next
              link_next[0] = root
          key = link[2]
          del self.__map[key]
          value = dict.pop(self, key)
          return key, value
function_tokens: def popitem ( self , last = True ) : if not self : raise KeyError ( 'dictionary is empty' ) root = self . __root if last : link = root [ 0 ] link_prev = link [ 0 ] link_prev [ 1 ] = root root [ 0 ] = link_prev else : link = root [ 1 ] link_next = link [ 1 ] root [ 1 ] = link_next link_next [ 0 ] = root key = link [ 2 ] del self . __map [ key ] value = dict . pop ( self , key ) return key , value