def merge_blocks(a_blocks, b_blocks):
<EOL>assert a_blocks[-<NUM_LIT:1>][<NUM_LIT:2>] == b_blocks[-<NUM_LIT:1>][<NUM_LIT:2>] == <NUM_LIT:0> <EOL>assert a_blocks[-<NUM_LIT:1>] == b_blocks[-<NUM_LIT:1>]<EOL>combined_blocks = sorted(list(set(a_blocks + b_blocks)))<EOL>i = j = <NUM_LIT:0><EOL>for a, b, size in combined_blocks:<EOL><INDENT>assert i <= a<EOL>assert j <= b<EOL>i = a + size<EOL>j = b + size<EOL><DEDENT>return combined_blocks<EOL>
Given two lists of blocks, combine them, in the proper order.

    Ensure that there are no overlaps, and that they are for sequences of the
    same length.