code: def test_stepsampler_regionmh_adapt(plot=False):
      np.random.seed(8)
      region = make_region(len(paramnames))
      Ls = loglike_vectorized(region.u)
      try:
          RegionMHSampler(
              nsteps=len(paramnames), adaptive_nsteps="Hello"
          )
          assert False, "expected error"
      except ValueError:
          pass
  
      for sampler_class in (
          RegionMHSampler,
          CubeMHSampler,
          CubeSliceSampler,
          RegionSliceSampler,
      ):
          for adaptation in (
              False,
              "move-distance",
              "proposal-total-distances",
              "proposal-summed-distances",
          ):
              print()
              stepsampler = sampler_class(
                  nsteps=len(paramnames), adaptive_nsteps=adaptation
              )
              print(stepsampler)
              stepsampler.region_changed(Ls, region)
              np.random.seed(23)
              old_scale = stepsampler.scale
              for i in range(5):
                  while True:
                      unew, pnew, Lnew, nc = stepsampler.__next__(
                          region,
                          -1e100,
                          region.u,
                          Ls,
                          transform,
                          loglike,
                      )
                      if unew is not None:
                          break
              new_scale = stepsampler.scale
              assert new_scale != old_scale
  
              if adaptation:
                  assert stepsampler.nsteps != len(paramnames)
              else:
                  assert stepsampler.nsteps == len(paramnames)
  
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 13 for calling a global function with example usage: test_stepsampler_regionmh_adapt(plot) without return types