code: def simplify_types(types):
      # type: (Iterable[AbstractType]) -> List[AbstractType]
      
      flattened = flatten_types(types)
      items = filter_ignored_items(flattened)
      items = [simplify_recursive(item) for item in items]
      items = merge_items(items)
      items = dedupe_types(items)
      # We have to remove reundant items after everything has been simplified and
      # merged as this simplification may be what makes items redundant.
      items = remove_redundant_items(items)
      if len(items) > 3:
          return [AnyType()]
      else:
          return items
docs: Given some types, give simplified types representing the union of types.