input: Write a function to extract the top 10 most frequent words from a given text in Python. If the text has fewer than 10 unique words, return only the unique words sorted by their frequency. The function should handle punctuation and case-insensitivity by converting the text to lowercase and removing punctuation. The function should return a list of tuples where each tuple contains a word and its frequency.
  assert extract_top_words("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.")==[('dolor', 1), ('lorem', 1), ('ipsum', 1), ('amet', 1), ('consectetur', 1), ('adipiscing', 1), ('elit', 1), ('sed', 1), ('do', 1), ('eiusmod', 1)]
  assert extract_top_words("Python is great, is it not? It surely is!")==[('it', 2), ('is', 2), ('python', 1), ('great', 1), ('not', 1), ('surely', 1)]
  assert extract_top_words("A fox jumps over the lazy dog. The dog barks back.")==[('dog', 2), ('the', 2), ('a', 1), ('fox', 1), ('jumps', 1), ('over', 1), ('lazy', 1), ('barks', 1), ('back', 1)]
  assert extract_top_words("Roses are red, violets are blue.")==[('are', 2), ('roses', 1), ('red', 1), ('violets', 1), ('blue', 1)]
  assert extract_top_words("")==[]
output: def extract_top_words(text):
      import string
      from collections import Counter
      
      text = text.lower()
      text = text.translate(str.maketrans('', '', string.punctuation))
      words = text.split()
      
      word_counts = Counter(words)
      sorted_words = sorted(word_counts.items(), key=lambda x: x[1], reverse=True)
      
      return sorted_words[:10]