input: Write a python function to read a file, count the occurrences of each word (ignoring case and punctuation), and return the top ten most common words.
  assert top_ten_words('test1.txt') == [('the', 15), ('and', 12), ('to', 10), ('of', 9), ('a', 8), ('in', 7), ('that', 6), ('is', 5), ('with', 4), ('for', 3)]
  assert top_ten_words('test2.txt') == [('example', 5), ('word', 4), ('text', 3), ('file', 3), ('this', 2), ('another', 2), ('test', 2), ('with', 1), ('some', 1), ('words', 1)]
  assert top_ten_words('test3.txt') == [('python', 7), ('code', 5), ('function', 4), ('file', 3), ('data', 3), ('script', 2), ('example', 2), ('top', 1), ('ten', 1), ('most', 1)]
output: def top_ten_words(filename):
      import string
      from collections import Counter
      
      with open(filename, 'r') as file:
          text = file.read()
      
      # Remove punctuation and make lowercase
      translator = str.maketrans('', '', string.punctuation)
      text = text.translate(translator).lower()
      
      # Split into words and count
      words = text.split()
      word_counts = Counter(words)
      
      # Get the 10 most common words
      most_common = word_counts.most_common(10)
      
      return most_common