code: def convert_to_cuts(intervals):  # pragma: no cover
      if len(intervals) == 0:
          raise Exception("intervals must have at least one interval")
  
      if any(len(x) != 2 for x in intervals):
          raise Exception("intervals must be a list of tuples")
  
      if intervals[0][0] != -np.inf:
          raise Exception("intervals must start from -inf")
  
      if intervals[-1][-1] != np.inf:
          raise Exception("intervals must end with inf")
  
      cuts = [x[0] for x in intervals[1:]]
      cuts_verify = [x[1] for x in intervals[:-1]]
  
      if np.isnan(cuts).any():
          raise Exception("intervals cannot contain NaN")
  
      if any(x[0] != x[1] for x in zip(cuts, cuts_verify)):
          raise Exception("intervals must contain adjacent sections")
  
      if any(higher <= lower for lower, higher in zip(cuts, cuts[1:])):
          raise Exception("intervals must contain increasing sections")
  
      return cuts
  
imports: from math import ceil, isnan, isinf, exp, log
  from ...utils._native import Native
  from ._tensor import restore_missing_value_zeros
  import numpy
  import warnings
  from itertools import islice
  import logging
label_desc: Use image node_id 12 for calling a global function with example usage: convert_to_cuts(intervals) and returns: cuts