input: from typing import List
  
  
  def reverse_double_linked_list(lst: List[Node], forward: str) -> List[Node]:
      """ Reverse a doubly linked list given its head node and the direction of traversal ('f' for forward, 'b' for backward).
      The function should return the updated list after reversing in the specified direction.
      >>> node1 = Node(1)
      >>> node2 = Node(2)
      >>> node1.next = node2
      >>> node2.prev = node1
      >>> node3 = Node(3)
      >>> node2.next = node3
      >>> node3.prev = node2
      >>> reverse_double_linked_list([node1, node2, node3], 'f')
      [node3, node2, node1]
      >>> reverse_double_linked_list([node1, node2, node3], 'b')
      [node1, node2, node3]
      """
output:     if forward == 'f':
          lst.reverse()
          for i in range(len(lst) - 1):
              lst[i].next = lst[i + 1]
              lst[i + 1].prev = lst[i]
          lst[-1].next = None
          lst[0].prev = None
      elif forward == 'b':
          for i in range(len(lst) - 1):
              lst[i].next = lst[i + 1]
              lst[i + 1].prev = lst[i]
          lst[-1].next = None
          lst[0].prev = None
      return lst