def array_to_native(array, inplace=False):
if numpy.little_endian:<EOL><INDENT>machine_little = True<EOL><DEDENT>else:<EOL><INDENT>machine_little = False<EOL><DEDENT>data_little = False<EOL>if array.dtype.names is None:<EOL><INDENT>if array.dtype.base.byteorder == '<STR_LIT:|>':<EOL><INDENT>return array<EOL><DEDENT>data_little = is_little_endian(array)<EOL><DEDENT>else:<EOL><INDENT>for fname in array.dtype.names:<EOL><INDENT>if is_little_endian(array[fname]):<EOL><INDENT>data_little = True<EOL>break<EOL><DEDENT><DEDENT><DEDENT>if ((machine_little and not data_little)<EOL>or (not machine_little and data_little)):<EOL><INDENT>output = array.byteswap(inplace)<EOL><DEDENT>else:<EOL><INDENT>output = array<EOL><DEDENT>return output<EOL>
Convert an array to the native byte order.

NOTE: the inplace keyword argument is not currently used.