input: Write a function to implement a doubly linked list in Python that supports appending, prepending, and reversing operations. The function should include a Node class and a DoubleLinkedList class. Return the updated linked list after performing the specified operations.
  assert isinstance(DoubleLinkedList(), DoubleLinkedList)
  assert DoubleLinkedList().head is None
  dll = DoubleLinkedList()
  dll.append(10)
  dll.prepend(5)
  dll.append(20)
  dll.reverse()
  assert dll.head.data == 20
  assert dll.head.next.data == 10
  assert dll.head.next.next.data == 5
output: class Node:
      def __init__(self, data):
          self.data = data
          self.next = None
          self.prev = None
  
  class DoubleLinkedList:
      def __init__(self):
          self.head = None
  
      def append(self, data):
          new_node = Node(data)
          if self.head is None:
              self.head = new_node
          else:
              current = self.head
              while current.next:
                  current = current.next
              current.next = new_node
              new_node.prev = current
  
      def prepend(self, data):
          new_node = Node(data)
          if self.head is None:
              self.head = new_node
          else:
              new_node.next = self.head
              self.head.prev = new_node
              self.head = new_node
  
      def reverse(self):
          current = self.head
          while current:
              current.next, current.prev = current.prev, current.next
              if current.prev is None:
                  self.head = current
              current = current.prev