def simplify(geoids):
from collections import defaultdict<EOL>aggregated = defaultdict(set)<EOL>d = {}<EOL>for g in geoids:<EOL><INDENT>if not bool(g):<EOL><INDENT>continue<EOL><DEDENT>av = g.allval()<EOL>d[av] = None<EOL>aggregated[av].add(g)<EOL><DEDENT>compiled = set()<EOL>for k, v in aggregated.items():<EOL><INDENT>if len(v) >= <NUM_LIT:5>:<EOL><INDENT>compiled.add(k)<EOL>compiled.add(k.promote())<EOL><DEDENT>else:<EOL><INDENT>compiled |= v<EOL><DEDENT><DEDENT>return compiled<EOL>
Given a list of geoids, reduce it to a simpler set. If there are five or more geoids at one summary level
convert them to a single geoid at the higher level.

:param geoids:
:return: