input: Write a python function to count the most common words in text files in a directory using the Counter class.
  assert count_common_words('test_folder')=={'the': 15, 'and': 10, 'to': 8, 'a': 6, 'in': 5}
  assert count_common_words('another_folder')=={'data': 20, 'science': 15, 'machine': 12, 'learning': 10, 'python': 8}
  assert count_common_words('empty_folder')=={}
output: def count_common_words(directory):
      from collections import Counter
      import os
  
      word_counter = Counter()
  
      for filename in os.listdir(directory):
          if filename.endswith('.txt'):
              filepath = os.path.join(directory, filename)
              with open(filepath, 'r', encoding='utf-8') as file:
                  words = file.read().lower().split()
                  word_counter.update(words)
  
      return dict(word_counter.most_common(5))