code: def test_init():
      bio = BytesIO()
      shape = [2, 3, 4]
      dtype = np.int32
      arr = np.arange(24, dtype=dtype).reshape(shape)
      bio.seek(16)
      bio.write(arr.tobytes(order="F"))
      hdr = FunkyHeader(shape)
      ap = ArrayProxy(bio, hdr)
      assert ap.file_like is bio
      assert ap.shape == shape
      # shape should be read only
      with pytest.raises(AttributeError):
          ap.shape = shape
      # Get the data
      assert_array_equal(np.asarray(ap), arr)
      # Check we can modify the original header without changing the ap version
      hdr.shape[0] = 6
      assert ap.shape != shape
      # Data stays the same, also
      assert_array_equal(np.asarray(ap), arr)
      # You wouldn't do this, but order=None explicitly requests the default order
      ap2 = ArrayProxy(bio, FunkyHeader(arr.shape), order=None)
      assert_array_equal(np.asarray(ap2), arr)
      # C order also possible
      bio = BytesIO()
      bio.seek(16)
      bio.write(arr.tobytes(order="C"))
      ap = CArrayProxy(bio, FunkyHeader((2, 3, 4)))
      assert_array_equal(np.asarray(ap), arr)
      # Illegal init
      with pytest.raises(TypeError):
          ArrayProxy(bio, object())
      with pytest.raises(ValueError):
          ArrayProxy(bio, hdr, order="badval")
  
imports: import contextlib
  import gzip
  import pickle
  from io import BytesIO
  from unittest import mock
  import numpy
  import pytest
  from numpy.testing import assert_array_almost_equal, assert_array_equal
  from packaging.version import Version
  from ..None import __version__
  from ..arrayproxy import ArrayProxy, get_obj_dtype, is_proxy, reshape_dataobj
  from ..deprecator import ExpiredDeprecationError
  from ..nifti1 import Nifti1Header, Nifti1Image
  from ..openers import ImageOpener
  from ..testing import memmap_after_ufunc
  from ..tmpdirs import InTemporaryDirectory
  from .test_fileslice import slicer_samples
  from .test_openers import patch_indexed_gzip
label_desc: Use image node_id 1 for calling a global function with example usage: test_init() without return types