input: Write a python function to generate all anagrams of a given set of words.
  assert set(generate_anagrams({'ab', 'ba'})) == {'ab', 'ba'}
  assert set(generate_anagrams({'abc', 'cab', 'bca'})) == {'abc', 'cab', 'bca', 'bac', 'acb', 'cba'}
  assert set(generate_anagrams({'cat', 'act', 'tac'})) == {'cat', 'act', 'tac', 'atc', 'tca', 'cta'}
output: def generate_anagrams(words):
      from itertools import permutations
      anagrams = set()
      for word in words:
          anagrams.update([''.join(p) for p in permutations(word)])
      return anagrams