#NEWLINE# def _offset( window , center ) : #NEWLINE# #INDENT# if ( not com . is_integer ( window ) ) : #NEWLINE# #INDENT# window = len ( window ) #NEWLINE# #UNINDENT# offset = ( ( ( window - 1 ) / 2.0 ) if center else 0 ) #NEWLINE# try : #NEWLINE# #INDENT# return int ( center ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# return offset . astype ( int )