#NEWLINE# def _force_native_endianness( var ) : #NEWLINE# #INDENT# if ( var . dtype . byteorder not in [ '=' , '|' ] ) : #NEWLINE# #INDENT# data = var . data . astype ( var . dtype . newbyteorder ( '=' ) ) #NEWLINE# var = Variable ( var . dims , data , var . attrs , var . encoding ) #NEWLINE# var . encoding . pop ( 'endian' , None ) #NEWLINE# #UNINDENT# if ( not ( var . encoding . get ( 'endian' , 'native' ) is 'native' ) ) : #NEWLINE# #INDENT# raise NotImplementedError ( 'Attempt to write non-native endian type, this is not supported by the netCDF4 python library.' ) #NEWLINE# #UNINDENT# return var