input: Write a python function to get anagrams from a list of words.
  assert get_anagrams(['cinema', 'iceman', 'dog', 'odg', 'god', 'listen', 'silent']) == [['cinema', 'iceman'], ['dog', 'odg'], ['dog', 'god'], ['odg', 'god'], ['listen', 'silent']]
  assert get_anagrams(['cat', 'tac', 'act', 'god', 'dog']) == [['cat', 'tac'], ['cat', 'act'], ['tac', 'act'], ['god', 'dog']]
  assert get_anagrams(['abc', 'bca', 'cab', 'xyz']) == [['abc', 'bca'], ['abc', 'cab'], ['bca', 'cab']]
output: def get_anagrams(words):
      from collections import defaultdict
      
      anagram_dict = defaultdict(list)
      for word in words:
          sorted_word = ''.join(sorted(word))
          anagram_dict[sorted_word].append(word)
      
      anagrams = []
      for word_list in anagram_dict.values():
          if len(word_list) > 1:
              for i in range(len(word_list)):
                  for j in range(i + 1, len(word_list)):
                      anagrams.append([word_list[i], word_list[j]])
      
      return anagrams