code: def _sequentialize_width_sequence(minimal_widths, min_width):
      """Turn a list of required tree width into an ordered sequence.
  
      Parameters
      ------------
      minimal_widths: list of (Llo, Lhi, width)
          Defines the required width between Llo and Lhi.
      min_width: int
          Minimum width everywhere.
  
      Returns
      ---------
      Lsequence: list of (L, width)
          A sequence of L points and the expected tree width at and above it.
  
      """
      Lpoints = np.unique(
          _listify(
              [-np.inf],
              [L for L, _, _ in minimal_widths],
              [L for _, L, _ in minimal_widths],
              [np.inf],
          )
      )
      widths = np.ones(len(Lpoints)) * min_width
  
      for Llo, Lhi, width in minimal_widths:
          # all Lpoints within that range should be maximized to width
          # mask = np.logical_and(Lpoints >= Llo, Lpoints <= Lhi)
          # the following allows segments to specify -inf..L ranges
          mask = ~np.logical_or(Lpoints < Llo, Lpoints > Lhi)
          widths[mask] = np.where(
              widths[mask] < width, width, widths[mask]
          )
  
      # the width has to monotonically increase to the maximum from both sides
      # so we fill up any intermediate dips
      max_width = widths.max()
      mid = np.where(widths == max_width)[0][0]
      widest = 0
      for i in range(mid):
          widest = widths[i] = max(widest, widths[i])
      widest = 0
      for i in range(len(widths) - 1, mid, -1):
          widest = widths[i] = max(widest, widths[i])
  
      return list(zip(Lpoints, widths))
  
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 2 for calling a global function with example usage: _sequentialize_width_sequence(minimal_widths, min_width) and returns: list