<doocs>1914.Cyclically Rotating a Grid_1.py
def rotate(grid, s1, e1, s2, e2, k):
    t = []
    for j in range(e2, e1, -1):
        t.append(grid[s1][j])
    for i in range(s1, s2):
        t.append(grid[i][e1])
    for j in range(e1, e2):
        t.append(grid[s2][j])
    for i in range(s2, s1, -1):
        t.append(grid[i][e2])
    k %= len(t)
    t = t[-k:] + t[:-k]
    k = 0
    for j in range(e2, e1, -1):
        grid[s1][j] = t[k]
        k += 1
    for i in range(s1, s2):
        grid[i][e1] = t[k]
        k += 1
    for j in range(e1, e2):
        grid[s2][j] = t[k]
        k += 1
    for i in range(s2, s1, -1):
        grid[i][e2] = t[k]
        k += 1
def sample_funcname ( var_0 , var_1 , var_2 , var_3 , var_4 , var_5 ) :
    var_6 = [ ]
    for var_9 in range ( var_4 , var_2 , - 1 ) :
        var_6.append ( var_0 [ var_1 ] [ var_9 ] )
    for var_11 in range ( var_1 , var_3 ) :
        var_6.append ( var_0 [ var_11 ] [ var_2 ] )
    for var_9 in range ( var_2 , var_4 ) :
        var_6.append ( var_0 [ var_3 ] [ var_9 ] )
    for var_11 in range ( var_3 , var_1 , - 1 ) :
        var_6.append ( var_0 [ var_11 ] [ var_4 ] )
    var_5 %= len ( var_6 )
    var_6 = var_6 [ - var_5 : ] + var_6 [ : - var_5 ]
    var_5 = 0
    for var_9 in range ( var_4 , var_2 , - 1 ) :
        var_0 [ var_1 ] [ var_9 ] = var_6 [ var_5 ]
        var_5 += 1
    for var_11 in range ( var_1 , var_3 ) :
        var_0 [ var_11 ] [ var_2 ] = var_6 [ var_5 ]
        var_5 += 1
    for var_9 in range ( var_2 , var_4 ) :
        var_0 [ var_3 ] [ var_9 ] = var_6 [ var_5 ]
        var_5 += 1
    for var_11 in range ( var_3 , var_1 , - 1 ) :
        var_0 [ var_11 ] [ var_4 ] = var_6 [ var_5 ]
        var_5 += 1
