code: def test_transform():
      np.random.seed(1)
      corrs = np.arange(-1, 1, 0.1)
      corrs *= 0.999
      for corr in corrs:
          for scaleratio in [1, 0.001]:
              covmatrix = np.array([[1.0, corr], [corr, 1.0]])
              points = np.random.multivariate_normal(
                  np.zeros(2), covmatrix, size=1000
              )
              print(corr, scaleratio, covmatrix.flatten(), points.shape)
              points[:, 0] = points[:, 0] * 0.01 * scaleratio + 0.5
              points[:, 1] = points[:, 1] * 0.01 + 0.5
  
              layer = ScalingLayer()
              layer.optimize(points, points)
              tpoints = layer.transform(points)
              assert tpoints.shape == points.shape, (
                  tpoints.shape,
                  points.shape,
              )
              points2 = layer.untransform(tpoints)
              assert tpoints.shape == points2.shape, (
                  tpoints.shape,
                  points2.shape,
              )
  
              assert (points2 == points).all(), (
                  points,
                  tpoints,
                  points2,
              )
  
              # transform a single point
              points = points[0]
              tpoints = layer.transform(points)
              assert tpoints.shape == points.shape, (
                  tpoints.shape,
                  points.shape,
              )
              points2 = layer.untransform(tpoints)
              assert tpoints.shape == points2.shape, (
                  tpoints.shape,
                  points2.shape,
              )
  
              assert (points2 == points).all(), (
                  points,
                  tpoints,
                  points2,
              )
  
imports: from ultranest.mlfriends import ScalingLayer, AffineLayer
  import numpy
  import matplotlib.pyplot
label_desc: Use image node_id 2 for calling a global function with example usage: test_transform() without return types