input: Write a python function to group anagrams from a list of words.
  assert anagram_grouping(["tea", "eat", "ate", "apple", "plea", "rat", "tar"]) == [['tea', 'eat', 'ate'], ['apple'], ['plea'], ['rat', 'tar']]
  assert anagram_grouping(["listen", "silent", "enlist", "google", "gogole"]) == [['listen', 'silent', 'enlist'], ['google', 'gogole']]
  assert anagram_grouping(["bat", "tab", "cat"]) == [['bat', 'tab'], ['cat']]
output: def anagram_grouping(words):
      from collections import defaultdict
      
      anagram_dict = defaultdict(list)
      
      for word in words:
          sorted_word = ''.join(sorted(word))
          anagram_dict[sorted_word].append(word)
      
      return list(anagram_dict.values())