code: def labels_to_ranges(labels: List[bool]) -> List[range]:
      """
      Converts the given list of labels to list of anomaly (defined by positive
      label) ranges.
  
      Parameters
      ----------
      labels
          Boolean list of labels.
  
      Returns
      -------
      List of ranges.
      """
  
      labels_np = np.array(labels)
      labels_np[np.isnan(labels_np)] = 0
      ls_pairs = labels_to_ranges_numba(labels_np)
      return [range(pair[0], pair[1]) for pair in ls_pairs]
  
imports: from typing import List, Tuple
  import numpy
  from numba import jit
label_desc: Use image node_id 3 for calling a global function with example usage: labels_to_ranges(labels) and returns: unknown