linked lists class doublylinkedbase """ base class providing doubly linked list representation "" class node """lightweightnonpublic class for storing doubly linked node "" (omitted heresee previous code fragment def init (self) """create an empty list "" self header self node(nonenonenone self trailer self node(nonenonenonetrailer is after header self header next self trailer header is before trailer self trailer prev self header self size number of elements def len (self) """return the number of elements in the list "" return self size def is empty(self) """return true if list is empty "" return self size = def insert between(selfepredecessorsuccessor) """add element between two existing nodes and return new node "" newest self node(epredecessorsuccessorlinked to neighbors predecessor next newest successor prev newest self size + return newest def delete node(selfnode) """delete nonsentinel node from the list and return its element "" predecessor node prev successor node next predecessor next successor successor prev predecessor self size - record deleted element element node element node prev node next node element none deprecate node return element return deleted element code fragment base class for managing doubly linked list