code: def test_defaults_ND():
      for arr_shape, in_names, out_names in (
          ((2, 3), "kj", "yz"),
          ((2, 3, 4), "ijk", "zyx"),
          ((2, 3, 4, 5), "hijk", "zyxt"),
      ):
          data = np.ones(arr_shape)
          ndim = len(arr_shape)
          img = Image(
              data,
              AffineTransform(in_names, out_names, np.eye(ndim + 1)),
          )
          assert isinstance(img._data, np.ndarray)
          assert img.ndim == len(arr_shape)
          assert img.shape == arr_shape
          assert img.affine.shape == (img.ndim + 1, img.ndim + 1)
          assert img.affine.diagonal().all()
          assert img.metadata == {}
  
imports: import warnings
  from itertools import chain
  import nibabel
  import numpy
  import pytest
  from numpy.testing import assert_almost_equal, assert_array_almost_equal, assert_array_equal
  from ...api import data_generator, parcels, write_data
  from ...reference.coordinate_map import AffineTransform, AxisError
  from ...reference.coordinate_system import CoordinateSystem
  from ..None import image
  from ..image import Image, is_image, iter_axis, rollimg
label_desc: Use image node_id 15 for calling a global function with example usage: test_defaults_ND() without return types