code: def toranges(window):
      """Normalize Windows to range tuples"""
      if isinstance(window, Window):
          return window.toranges()
      else:
          return window
  
imports: import collections
  from collections.abc import Iterable
  import functools
  import math
  import warnings
  from affine import Affine
  import attr
  import numpy
  from rasterio.errors import WindowError, RasterioDeprecationWarning
  from rasterio.transform import rowcol, guard_transform
label_desc: Use image node_id 2 for calling a global function with example usage: toranges(window) and returns: window, window