code: def compute_quantile_intervals_refined(
      steps, upoints, uweights, logsteps_max=20
  ):
      """Compute lower and upper axis quantiles.
  
      Parameters
      ------------
      steps: array
          list of quantiles q to compute, with dimensions
      upoints: array
          samples, with dimensions (N, d)
      uweights: array
          sample weights. N entries.
      logsteps_max: int
          number of intermediate steps to inject between largest quantiles interval and full unit cube
  
      Returns
      ---------
      ulo: array
          list of lower quantiles (at `q`), of shape (M, d), one entry per quantile and dimension d.
      uhi: array
          list of upper quantiles (at 1-`q`), of shape (M, d), one entry per quantile and dimension d.
      uinterpspace: array
          list of steps (length of `steps` plus `logsteps_max` long)
      """
      nboxes = len(steps)
      ulos_orig, uhis_orig = compute_quantile_intervals(
          steps, upoints, uweights
      )
      assert len(ulos_orig) == nboxes + 1
      assert len(uhis_orig) == nboxes + 1
  
      smallest_axis_width = np.min(uhis_orig[-2, :] - ulos_orig[-2, :])
      logsteps = min(
          logsteps_max,
          int(np.ceil(-np.log10(max(1e-100, smallest_axis_width)))),
      )
  
      weights = np.logspace(-logsteps, 0, logsteps + 1).reshape((-1, 1))
      # print("logspace:", weights, logsteps)
      assert len(weights) == logsteps + 1, (weights.shape, logsteps)
      # print("quantiles:", ulos_orig, uhis_orig)
      ulos_new = (
          ulos_orig[nboxes - 1, :].reshape((1, -1)) * (1 - weights)
          + 0 * weights
      )
      uhis_new = (
          uhis_orig[nboxes - 1, :].reshape((1, -1)) * (1 - weights)
          + 1 * weights
      )
  
      # print("additional quantiles:", ulos_new, uhis_new)
  
      ulos = np.vstack((ulos_orig[:-1, :], ulos_new))
      uhis = np.vstack((uhis_orig[:-1, :], uhis_new))
      # print("combined quantiles:", ulos, uhis)
      assert (ulos[-1, :] == 0).all()
      assert (uhis[-1, :] == 1).all()
  
      uinterpspace = np.ones(nboxes + logsteps + 1)
      uinterpspace[: nboxes + 1] = np.linspace(0, 1, nboxes + 1)
      assert 0 < uinterpspace[nboxes - 1] < 1, uinterpspace[nboxes]
      uinterpspace[nboxes:] = np.linspace(
          uinterpspace[nboxes - 1], 1, logsteps + 2
      )[1:]
  
      return ulos, uhis, uinterpspace
  
file_path: ultranest/ultranest/hotstart.py
imports: import numpy
  import scipy.stats
  from .utils import vectorize, resample_equal
label_desc: Use image node_id 5 for calling a global function with example usage: compute_quantile_intervals_refined(steps, upoints, uweights, logsteps_max) and returns: ulos,  uhis,  uinterpspace