docs: def _make_elastic_range(begin, end):
      """Generate an S-curved range of pages.
  
      Start from both left and right, adding exponentially growing indexes,
      until the two trends collide.
      """
      # Limit growth for huge numbers of pages.
      starting_factor = max(1, (end - begin) // 100)
      factor = _iter_factors(starting_factor)
      left_half, right_half = [], []
      left_val, right_val = begin, end
      right_val = end
      while left_val < right_val:
          left_half.append(left_val)
          right_half.append(right_val)
          next_factor = next(factor)
          left_val = begin + next_factor
          right_val = end - next_factor
      # If the trends happen to meet exactly at one point, retain it.
      if left_val == right_val:
          left_half.append(left_val)
      right_half.reverse()
      return left_half + right_half