input: Write a python function to count the ten most frequent words in a given text file.
  assert word_count('document.txt') == [('the', 15), ('of', 13), ('and', 10), ('to', 8), ('a', 7), ('in', 6), ('that', 5), ('is', 5), ('with', 4), ('as', 4)]
  assert word_count('sample.txt') == [('python', 12), ('code', 10), ('function', 8), ('write', 7), ('test', 6), ('with', 5), ('file', 5), ('words', 4), ('given', 4), ('count', 3)]
output: def word_count(filename):
      from collections import Counter
      import re
      
      with open(filename, 'r') as file:
          text = file.read().lower()
          
      words = re.findall(r'\b\w+\b', text)
      word_freq = Counter(words)
      
      return word_freq.most_common(10)