class_docstr: Dictionary that remembers insertion order
class_docstr_tok: ["Dictionary","that","remembers","insertion","order"]
docstr: Move an existing element to the end (or beginning if last==False).
  
  Raises KeyError if the element does not exist.
  When last=True, acts like a fast version of self[key]=self.pop(key).
docstr_tok: ["Move","an","existing","element","to","the","end","(","or","beginning","if","last==False",")",".","Raises","KeyError","if","the","element","does","not","exist",".","When","last=True",",","acts","like","a","fast","version","of","self","[","key","]","=self.pop","(","key",")","."]
code: def move_to_end(self, key, last=True):
      """Move an existing element to the end (or beginning if last==False).
  
      Raises KeyError if the element does not exist.
      When last=True, acts like a fast version of self[key]=self.pop(key).
  
      """
      link = self.__map[key]
      link_prev = link.prev
      link_next = link.next
      link_prev.next = link_next
      link_next.prev = link_prev
      root = self.__root
      if last:
          last = root.prev
          link.prev = last
          link.next = root
          last.next = root.prev = link
      else:
          first = root.next
          link.prev = root
          link.next = first
          root.next = first.prev = link
  
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 8 for calling the OrderedDict obj's underlying member method code with example usage: obj.move_to_end(key, last) without return types