Rectangularize a list-of-lists structure
You can find a maximum without sorting. Instead of

len(sorted(x,key=len, reverse=True)[0])


you can use either of these:

len(max(x, key=len))
max(len(s) for s in x)



For a more generic solution I propose this:

import itertools

def rectangularize(nested_list, dimensions, fill_value=None):
    flat = nested_list
    for dim in range(dimensions-2, -1, -1):
        size = max(len(s) for s in flat)
        for s in flat:
            s.extend([] if dim else fill_value for _ in range(size - len(s)))
        flat = list(itertools.chain.from_iterable(flat))

x=[[[[4,3,4,5],[1],[2,2]],[[3,6,7],[2,3],[1]]],[[[1]]]]
rectangularize(x, 4)
print(x)        


To explain:        


The flat list is a flattened view of one dimension of nested_list. It contains references to sublists of nested_list; extending the sublists through flat mutates nested_list.
flat = list(itertools.chain.from_iterable(flat)) advances flat to the next dimension by concatenating the sublists.
The main loop runs dimensions-1 times because the outermost list never needs to be extended. 
I'm using range(dimensions-2, -1, -1) to make dim == 0 in the final iteration where a different fill value is needed, so I can use a clean if dim else to deal with that.