input: Write a function to delete a node from a doubly linked list.
  assert dlist.delete(dlist.head.next) is None
  assert dlist.head.next.data == 3
  assert dlist.tail.data == 4
output: class Node:
      def __init__(self, data):
          self.data = data
          self.next = None
          self.prev = None
  
  class DoublyLinkedList:
      def __init__(self):
          self.head = None
          self.tail = None
      
      def append(self, data):
          new_node = Node(data)
          if not self.head:
              self.head = self.tail = new_node
          else:
              self.tail.next = new_node
              new_node.prev = self.tail
              self.tail = new_node
  
      def delete(self, node):
          if not self.head or not node:
              return
          
          if self.head == node:
              self.head = node.next
              if self.head:
                  self.head.prev = None
          elif self.tail == node:
              self.tail = node.prev
              if self.tail:
                  self.tail.next = None
          else:
              if node.prev:
                  node.prev.next = node.next
              if node.next:
                  node.next.prev = node.prev
  
          node.next = node.prev = None