code: def make_region(ndim, us=None):
      if us is None:
          us = np.random.uniform(size=(1000, ndim))
  
      if ndim > 1:
          transformLayer = AffineLayer()
      else:
          transformLayer = ScalingLayer()
      transformLayer.optimize(us, us)
      region = MLFriends(us, transformLayer)
      region.maxradiussq, region.enlarge = region.compute_enlargement(
          nbootstraps=30
      )
      region.create_ellipsoid(minvol=1.0)
      return region
  
imports: import numpy
  from ultranest.mlfriends import ScalingLayer, AffineLayer, MLFriends
  from ultranest import ReactiveNestedSampler
  from ultranest.stepsampler import RegionMHSampler, CubeMHSampler, CubeSliceSampler, RegionSliceSampler, SpeedVariableRegionSliceSampler, RegionBallSliceSampler
  from ultranest.stepsampler import generate_region_random_direction, ellipsoid_bracket, crop_bracket_at_unit_cube
  from ultranest.pathsampler import SamplingPathStepSampler
  from ultranest.stepsampler import select_random_livepoint, IslandPopulationRandomLivepointSelector
  from numpy.testing import assert_allclose
label_desc: Use image node_id 10 for calling a global function with example usage: make_region(ndim, us) and returns: region