input: Write a python function to reverse a double linked list.
  assert dll_to_list(reverse_double_linked_list([1, 2, 3, 4, 5])) == [5, 4, 3, 2, 1]
  assert dll_to_list(reverse_double_linked_list([10, 20, 30, 40])) == [40, 30, 20, 10]
  assert dll_to_list(reverse_double_linked_list([7])) == [7]
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 not self.head:
              self.head = new_node
              return
          last = self.head
          while last.next:
              last = last.next
          last.next = new_node
          new_node.prev = last
  
      def to_list(self):
          result = []
          current = self.head
          while current:
              result.append(current.data)
              current = current.next
          return result
  
  def list_to_dll(lst):
      dll = DoubleLinkedList()
      for item in lst:
          dll.append(item)
      return dll
  
  def dll_to_list(dll):
      return dll.to_list()
  
  def reverse_double_linked_list(lst):
      dll = list_to_dll(lst)
      current = dll.head
      temp = None
      while current:
          temp = current.prev
          current.prev = current.next
          current.next = temp
          current = current.prev
      if temp:
          dll.head = temp.prev
      return dll