input: Write a function to delete a specified node from a linked list. If the node to be deleted is the head, the next node should become the new head. If the node is not found in the linked list, the function should do nothing. The function should take the node to be deleted as an argument.
  
  
  class Node:
      def __init__(self, data):
          self.data = data
          self.next = None
  
  class LinkedList:
      def __init__(self):
          self.head = None
  
      def deleteNode(self, node):
          if not self.head:
              return
          
          if self.head == node:
              self.head = self.head.next
              return
          
          current = self.head
          while current.next:
              if current.next == node:
                  current.next = current.next.next
                  return
              current = current.next
  
  # Test cases
  linked_list = LinkedList()
  linked_list.head = Node(1)
  second = Node(2)
  third = Node(3)
  linked_list.head.next = second
  second.next = third
  
  # Delete the second node
  linked_list.deleteNode(second)
  assert linked_list.head.next == third
  
  # Delete the head node
  linked_list.deleteNode(linked_list.head)
  assert linked_list.head == third
  
  # Try to delete a non-existent node
  non_existent_node = Node(4)
  linked_list.deleteNode(non_existent_node)
  assert linked_list.head == third
  
output: def deleteNode(self, node):
      if not self.head:
          return
      
      if self.head == node:
          self.head = self.head.next
          return
      
      current = self.head
      while current.next:
          if current.next == node:
              current.next = current.next.next
              return
          current = current.next