code: def _check_dims(x, ndim, shape):
      if isinstance(shape, Number):
          shape = (shape,)
      for i in range(ndim):
          assert x.shape[i] == shape[i]
  
imports: from numbers import Number
  import numpy
  from numpy.testing import assert_almost_equal, assert_array_almost_equal
  from ....io.files import load
  from ....testing import anatfile
  from ..brain_segmentation import BrainT1Segmentation
  from ..segmentation import Segmentation
label_desc: Use image node_id 1 for calling a global function with example usage: _check_dims(x, ndim, shape) without return types