code: def ranges_to_singletons(
      ranges: List[range],
  ) -> List[range]:
      """
      Convenient function to convert list of consecutive ranges to list of
      singleton ranges.
  
      Parameters
      ----------
      ranges
          List of ranges.
  
      Returns
      -------
      List of singleton ranges.
      """
      assert all(
          r.step == 1 and r.start >= 0 and r.stop >= 0 for r in ranges
      ), "Ranges should be consecutive and contain non-negative indices."
  
      return [range(i, i + 1) for r in ranges for i in r]
  
imports: from typing import List, Tuple
  import numpy
  from numba import jit
label_desc: Use image node_id 4 for calling a global function with example usage: ranges_to_singletons(ranges) and returns: unknown