def union(*args):
   """
   Returns union of tuples/lists of data, where

   1) the dimensionality of the sets is not pre-defined,
       s1 = [(1,), 'e', [[1, 7], (4L, 3j, ('', None))], ([2], {'a': 'b'})]
   2) the sets are not required to share common dimensionality,
       s2 = (1, 2, 3, None)
   3) the union of one set is the set stripped of duplicates,
   4) the returned object is a one-dimensional list of objects which are
      neither TupleType nor ListType and has no duplicates.
       union(s1) == [{'a': 'b'}, 'e', 3j, None, 4L, 7, 2, 1, '']
       union(s1, s2) == [{'a': 'b'}, 'e', 3j, None, 4L, 7, 3, 2, 1, '']
   """
   result = []
   sequenceSet = (type([1]), type((1,)))
   result_extend = result.extend
   result_append = result.append

   for arg in args:
      if type(arg) in sequenceSet:
         for obj in arg:
            result_extend(union(obj))
      else:
         result_append(arg)

   return compact(result)

   Returns union of tuples/lists of data, where

   1) the dimensionality of the sets is not pre-defined,
       s1 = [(1,), 'e', [[1, 7], (4L, 3j, ('', None))], ([2], {'a': 'b'})]
   2) the sets are not required to share common dimensionality,
       s2 = (1, 2, 3, None)
   3) the union of one set is the set stripped of duplicates,
   4) the returned object is a one-dimensional list of objects which are
      neither TupleType nor ListType and has no duplicates.
       union(s1) == [{'a': 'b'}, 'e', 3j, None, 4L, 7, 2, 1, '']
       union(s1, s2) == [{'a': 'b'}, 'e', 3j, None, 4L, 7, 3, 2, 1, '']
   
recipes/Python/138982_Intersectiunivaried_form/recipe-138982.py