code: def _get_cumsum_range(pi, dp):
      """Compute quantile indices from probabilities.
  
      Parameters
      ------------
      pi: array
          probability of each item.
      dp: float
          Quantile (between 0 and 0.5).
  
      Returns
      ---------
      index_lo: int
          Index of the item corresponding to quantile ``dp``.
      index_hi: int
          Index of the item corresponding to quantile ``1-dp``.
      """
      ci = pi.cumsum()
      ilo = np.where(ci > dp)[0]
      ilo = ilo[0] if len(ilo) > 0 else 0
      ihi = np.where(ci < 1.0 - dp)[0]
      ihi = ihi[-1] if len(ihi) > 0 else -1
      return ilo, ihi
  
imports: from __future__ import print_function, division
  import os
  import sys
  import csv
  import json
  import operator
  import time
  import warnings
  from numpy import log, exp, logaddexp
  import numpy
  from .utils import create_logger, make_run_dir, resample_equal, vol_prefactor, vectorize, listify
  from .utils import is_affine_transform, normalised_kendall_tau_distance, distributed_work_chunk_size
  from ultranest.mlfriends import MLFriends, AffineLayer, ScalingLayer, find_nearby, WrappingEllipsoid, RobustEllipsoidRegion
  from .store import HDF5PointStore, TextPointStore, NullPointStore
  from .viz import get_default_viz_callback
  from .ordertest import UniformOrderAccumulator
  from .netiter import PointPile, SingleCounter, MultiCounter, BreadthFirstIterator, TreeNode, count_tree_between, find_nodes_before, logz_sequence
  from .netiter import dump_tree, combine_results
  from .hotstart import get_auxiliary_contbox_parameterization
label_desc: Use image node_id 1 for calling a global function with example usage: _get_cumsum_range(pi, dp) and returns: ilo,  ihi