code: def test_filename_exts():
      # Test acceptable filename extensions
      v = np.ones((7, 13, 3, 22), np.uint8)
      # form a MGHImage object using data
      # and the default affine matrix (Note the "None")
      img = MGHImage(v, None)
      # Check if these extensions allow round trip
      for ext in (".mgh", ".mgz"):
          with InTemporaryDirectory():
              fname = "tmpname" + ext
              save(img, fname)
              # read from the tmp file and see if it checks out
              img_back = load(fname)
              assert_array_equal(img_back.get_fdata(), v)
              del img_back
  
imports: import io
  import os
  import pathlib
  import numpy
  import pytest
  from numpy.testing import assert_almost_equal, assert_array_almost_equal, assert_array_equal
  from ...None import imageglobals
  from ...fileholders import FileHolder
  from ...openers import ImageOpener
  from ...spatialimages import HeaderDataError
  from ...testing import data_path
  from ...tests import test_spatialimages
  from ...tests import test_wrapstruct
  from ...tmpdirs import InTemporaryDirectory
  from ...volumeutils import sys_is_le
  from ...wrapstruct import WrapStructError
  from ..None import load, save
  from ..mghformat import MGHError, MGHHeader, MGHImage
label_desc: Use image node_id 7 for calling a global function with example usage: test_filename_exts() without return types