input: Write a python function to find anagrams from a list of words.
  assert find_anagrams(["dog", "god", "cat", "act"]) == [["dog", "god"], ["cat", "act"]]
  assert find_anagrams(["listen", "silent", "enlist", "google"]) == [["listen", "silent"], ["listen", "enlist"], ["silent", "enlist"]]
  assert find_anagrams(["apple", "pale", "leap", "peal"]) == [["pale", "leap"], ["pale", "peal"], ["leap", "peal"]]
output: def find_anagrams(words):
      from collections import defaultdict
  
      anagrams = defaultdict(list)
      for word in words:
          sorted_word = ''.join(sorted(word))
          anagrams[sorted_word].append(word)
  
      result = []
      for group in anagrams.values():
          if len(group) > 1:
              for i in range(len(group)):
                  for j in range(i + 1, len(group)):
                      result.append([group[i], group[j]])
      return result