input: Write a function to remove all the duplicates from a linked list in Python.
  
  ### Input:
  list_nodes = [7, 14, 28, 28, 28, 35, 49]
  
  ### Output:
  class Node: 
      # Function to initialise the node object 
      def __init__(self, data): 
          self.data = data # Assign data 
          self.next = None # Initialize next as null 
    
    
  # Linked List class contains a Node object 
  class LinkedList: 
      # Function to initialize head 
      def __init__(self): 
          self.head = None
  
      def remove_duplicates(self):
          unique_elements = set()
          current = self.head
          previous = None
          while current:
              if current.data in unique_elements:
                  previous.next = current.next
              else:
                  unique_elements.add(current.data)
                  previous = current
              current = current.next
      
      def insert_node(self, data): 
          new_node = Node(data) 
          if self.head is None: 
              self.head = new_node 
              return
          last = self.head 
          while (last.next): 
              last = last.next
          last.next =  new_node
  
  linked_list = LinkedList()
  linked_list.insert_node(7)
  linked_list.insert_node(14)
  linked_list.insert_node(28)
  linked_list.insert_node(28)
  linked_list.insert_node(28)
  linked_list.insert_node(35)
  linked_list.insert_node(49)
  
  linked_list.remove_duplicates()
  
  current_node = linked_list.head
  result_list = []
  while current_node:
      result_list.append(current_node.data)
      current_node = current_node.next
  
  assert result_list == [7, 14, 28, 35, 49]
output: def remove_duplicates(self):
      unique_elements = set()
      current = self.head
      previous = None
      while current:
          if current.data in unique_elements:
              previous.next = current.next
          else:
              unique_elements.add(current.data)
              previous = current
          current = current.next