def splitbins(t, trace=<NUM_LIT:0>):
if trace:<EOL><INDENT>def dump(t1, t2, shift, bytes):<EOL><INDENT>print("<STR_LIT>" % (<EOL>len(t1), len(t2), shift, bytes), file=sys.stderr)<EOL><DEDENT>print("<STR_LIT>", len(t)*getsize(t),"<STR_LIT>", file=sys.stderr)<EOL><DEDENT>n = len(t)-<NUM_LIT:1>    <EOL>maxshift = <NUM_LIT:0>    <EOL>if n > <NUM_LIT:0>:<EOL><INDENT>while n >> <NUM_LIT:1>:<EOL><INDENT>n >>= <NUM_LIT:1><EOL>maxshift += <NUM_LIT:1><EOL><DEDENT><DEDENT>del n<EOL>bytes = sys.maxsize  <EOL>t = tuple(t)    <EOL>for shift in range(maxshift + <NUM_LIT:1>):<EOL><INDENT>t1 = []<EOL>t2 = []<EOL>size = <NUM_LIT:2>**shift<EOL>bincache = {}<EOL>for i in range(<NUM_LIT:0>, len(t), size):<EOL><INDENT>bin = t[i:i+size]<EOL>index = bincache.get(bin)<EOL>if index is None:<EOL><INDENT>index = len(t2)<EOL>bincache[bin] = index<EOL>t2.extend(bin)<EOL><DEDENT>t1.append(index >> shift)<EOL><DEDENT>b = len(t1)*getsize(t1) + len(t2)*getsize(t2)<EOL>if trace > <NUM_LIT:1>:<EOL><INDENT>dump(t1, t2, shift, b)<EOL><DEDENT>if b < bytes:<EOL><INDENT>best = t1, t2, shift<EOL>bytes = b<EOL><DEDENT><DEDENT>t1, t2, shift = best<EOL>if trace:<EOL><INDENT>print("<STR_LIT>", end='<STR_LIT:U+0020>', file=sys.stderr)<EOL>dump(t1, t2, shift, bytes)<EOL><DEDENT>if __debug__:<EOL><INDENT>mask = ~((~<NUM_LIT:0>) << shift) <EOL>for i in range(len(t)):<EOL><INDENT>assert t[i] == t2[(t1[i >> shift] << shift) + (i & mask)]<EOL><DEDENT><DEDENT>return best<EOL>
t, trace=0 -> (t1, t2, shift).  Split a table to save space.

    t is a sequence of ints.  This function can be useful to save space if
    many of the ints are the same.  t1 and t2 are lists of ints, and shift
    is an int, chosen to minimize the combined size of t1 and t2 (in C
    code), and where for each i in range(len(t)),
        t[i] == t2[(t1[i >> shift] << shift) + (i & mask)]
    where mask is a bitmask isolating the last "shift" bits.

    If optional arg trace is non-zero (default zero), progress info
    is printed to sys.stderr.  The higher the value, the more info
    you'll get.