#NEWLINE# def padding( win_shape , border_mode ) : #NEWLINE# #INDENT# if ( border_mode == 'valid' ) : #NEWLINE# #INDENT# return ( 0 , 0 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( border_mode == 'same' ) : #NEWLINE# #INDENT# return ( ( win_shape [ 0 ] // 2 ) , ( win_shape [ 1 ] // 2 ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( border_mode == 'full' ) : #NEWLINE# #INDENT# return ( ( win_shape [ 0 ] - 1 ) , ( win_shape [ 1 ] - 1 ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise ValueError ( ( 'invalid mode: "%s"' % border_mode ) )