@lru_cache()<EOL>def partitions_of_size(n, count):
<EOL>if count < <NUM_LIT:1> or n < count:<EOL><INDENT>return set()<EOL><DEDENT>if count == <NUM_LIT:1>:<EOL><INDENT>return {(n,)}<EOL><DEDENT>if n == count:<EOL><INDENT>return {(<NUM_LIT:1>,)*count}<EOL><DEDENT>if n == count+<NUM_LIT:1>:<EOL><INDENT>return {(<NUM_LIT:1>,)*(count-<NUM_LIT:1>) + (<NUM_LIT:2>,)}<EOL><DEDENT>combos = set()<EOL>for i in range(n-<NUM_LIT:1>, count-<NUM_LIT:2>, -<NUM_LIT:1>):<EOL><INDENT>news = partitions_of_size(i, count-<NUM_LIT:1>)<EOL>for new in news:<EOL><INDENT>out = [n-i] + list(new)<EOL>out.sort()<EOL>out = tuple(out)<EOL>combos.add(out)<EOL><DEDENT><DEDENT>return combos<EOL>
Creates all combinations of `count` numbers that sum to n (order doesn't
    matter, so combos are returned in sorted form)