code: def test_base64_written():
      with InTemporaryDirectory():
          with open(DATA_FILE5, "rb") as fobj:
              contents = fobj.read()
          # Confirm the bad tags are still in the file
          assert b"GIFTI_ENCODING_B64BIN" in contents
          assert b"GIFTI_ENDIAN_LITTLE" in contents
          # The good ones are missing
          assert b"Base64Binary" not in contents
          assert b"LittleEndian" not in contents
          # Round trip
          img5 = load(DATA_FILE5)
          save(img5, "fixed.gii")
          with open("fixed.gii", "rb") as fobj:
              contents = fobj.read()
          # The bad codes have gone, replaced by the good ones
          assert b"GIFTI_ENCODING_B64BIN" not in contents
          assert b"GIFTI_ENDIAN_LITTLE" not in contents
          assert b"Base64Binary" in contents
          if sys.byteorder == "little":
              assert b"LittleEndian" in contents
          else:
              assert b"BigEndian" in contents
          img5_fixed = load("fixed.gii")
          darrays = img5_fixed.darrays
          assert_array_almost_equal(darrays[0].data, DATA_FILE5_darr1)
          assert_array_almost_equal(darrays[1].data, DATA_FILE5_darr2)
  
imports: import shutil
  import sys
  import warnings
  from os.path import basename, dirname
  from os.path import join
  from unittest import mock
  import numpy
  import pytest
  from numpy.testing import assert_array_almost_equal
  from ...loadsave import load, save
  from ...nifti1 import xform_codes
  from ...testing import clear_and_catch_warnings, suppress_warnings
  from ...tmpdirs import InTemporaryDirectory
  from ..None import gifti
  from ..parse_gifti_fast import GiftiImageParser, GiftiParseError
  from ..util import gifti_endian_codes
label_desc: Use image node_id 10 for calling a global function with example usage: test_base64_written() without return types