input: Write a python function to find the top 10 most frequent words in a text file.
  assert top_10_words('text.txt') == ['the', 'and', 'to', 'of', 'a', 'in', 'is', 'it', 'you', 'that']
  assert top_10_words('sample.txt') == ['this', 'is', 'a', 'test', 'Hello', 'there', 'I', 'am', 'to', 'see']
output: def top_10_words(filename):
      from collections import Counter
      import re
  
      # Read the contents of the file
      with open(filename, 'r') as file:
          text = file.read()
  
      # Use regex to find words (alphanumeric characters)
      words = re.findall(r'\b\w+\b', text.lower())
  
      # Get the frequency of each word
      word_counts = Counter(words)
  
      # Get the top 10 most frequent words
      top_10 = [word for word, count in word_counts.most_common(10)]
  
      return top_10