input: 
  def create_linked_list():
      """
      Create a class DoubleLinkedList that can handle nodes in both directions.
      The class should have methods to append, prepend, and reverse the linked list.
      Example:
      >>> dlist = create_linked_list()
      >>> dlist.append(1)
      >>> dlist.append(2)
      >>> dlist.prepend(0)
      >>> dlist.reverse()
      >>> node = dlist.head
      >>> print([node.data for node in dlist if node])
      [2, 1, 0]
      """
      # Implementation here
  
output:     
      class Node:
          def __init__(self, data):
              self.data = data
              self.next = None
              self.prev = None
  
      class DoubleLinkedList:
          def __init__(self):
              self.head = None
              self.tail = None
  
          def append(self, data):
              new_node = Node(data)
              if not self.head:
                  self.head = new_node
                  self.tail = new_node
              else:
                  new_node.prev = self.tail
                  self.tail.next = new_node
                  self.tail = new_node
  
          def prepend(self, data):
              new_node = Node(data)
              if not self.head:
                  self.head = new_node
                  self.tail = 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:
                  temp = current.next
                  current.next = current.prev
                  current.prev = temp
                  current = temp
              self.head, self.tail = self.tail, self.head
  
          def __iter__(self):
              current = self.head
              while current:
                  yield current
                  current = current.next
  
      return DoubleLinkedList
  