<doocs>0711.Number of Distinct Islands II_1.py
def normalize(shape):
    shapes = [[] for _ in range(8)]
    for i, j in shape:
        shapes[0].append([i, j])
        shapes[1].append([i, -j])
        shapes[2].append([-i, j])
        shapes[3].append([-i, -j])
        shapes[4].append([j, i])
        shapes[5].append([j, -i])
        shapes[6].append([-j, i])
        shapes[7].append([-j, -i])
    for e in shapes:
        e.sort()
        for i in range(len(e) - 1, -1, -1):
            e[i][0] -= e[0][0]
            e[i][1] -= e[0][1]
    shapes.sort()
    return tuple(tuple(e) for e in shapes[0])
def sample_funcname ( var_0 ) :
    var_4 = [ [ ] for var_1 in range ( 8 ) ]
    for var_5 , var_6 in var_0 :
        var_4 [ 0 ].append ( [ var_5 , var_6 ] )
        var_4 [ 1 ].append ( [ var_5 , - var_6 ] )
        var_4 [ 2 ].append ( [ - var_5 , var_6 ] )
        var_4 [ 3 ].append ( [ - var_5 , - var_6 ] )
        var_4 [ 4 ].append ( [ var_6 , var_5 ] )
        var_4 [ 5 ].append ( [ var_6 , - var_5 ] )
        var_4 [ 6 ].append ( [ - var_6 , var_5 ] )
        var_4 [ 7 ].append ( [ - var_6 , - var_5 ] )
    for var_16 in var_4 :
        var_16.sort ( )
        for var_5 in range ( len ( var_16 ) - 1 , - 1 , - 1 ) :
            var_16 [ var_5 ] [ 0 ] -= var_16 [ 0 ] [ 0 ]
            var_16 [ var_5 ] [ 1 ] -= var_16 [ 0 ] [ 1 ]
    var_4.sort ( )
    return tuple ( tuple ( var_16 ) for var_16 in var_4 [ 0 ] )
