code: def create_random_image_pair(sh, nvals, rng=None):
      r"""Create a pair of images with an arbitrary, non-uniform joint PDF
  
      Parameters
      ----------
      sh : array, shape (dim,)
          the shape of the images to be created
      nvals : int
          maximum number of different values in the generated 2D images.
          The voxel intensities of the returned images will be in
          {0, 1, ..., nvals-1}
      rng : numpy.random.generator
          numpy's random generator. If None, it is set with a random seed.
          Default is None
  
      Returns
      -------
      static : array, shape=sh
          first image in the image pair
      moving : array, shape=sh
          second image in the image pair
      """
      if rng is None:
          rng = np.random.default_rng()
      sz = reduce(mul, sh, 1)
      sh = tuple(sh)
      static = rng.integers(0, nvals, sz).reshape(sh)
  
      # This is just a simple way of making  the distribution non-uniform
      moving = static.copy()
      moving += rng.integers(0, nvals // 2, sz).reshape(sh) - nvals // 4
  
      # This is just a simple way of making  the distribution non-uniform
      static = moving.copy()
      static += rng.integers(0, nvals // 2, sz).reshape(sh) - nvals // 4
  
      return static.astype(np.float64), moving.astype(np.float64)
  
imports: import numpy
  import scipy
  from functools import reduce
  from operator import mul
  from dipy.core.ndindex import ndindex
  from dipy.core.interpolation import interpolate_scalar_2d, interpolate_scalar_3d
  from dipy.data import get_fnames
  from dipy.align import vector_fields
  from dipy.align.transforms import regtransforms
  from dipy.align.parzenhist import ParzenJointHistogram, cubic_spline, cubic_spline_derivative, sample_domain_regular
  from numpy.testing import assert_array_equal, assert_array_almost_equal, assert_almost_equal, assert_equal, assert_raises
  from dipy.testing.decorators import set_random_number_generator
label_desc: Use image node_id 1 for calling a global function with example usage: create_random_image_pair(sh, nvals, rng) and returns: static,  moving