code: def group_ranges(ranges):
      """Group any overlapping ranges into a single range.
  
      Parameters
      ----------
      ranges : iterable[ranges]
          A sorted sequence of ranges to group.
  
      Returns
      -------
      grouped : iterable[ranges]
          A sorted sequence of ranges with overlapping ranges merged together.
      """
      return foldr(_combine, ranges, ())
  
file_path: zipline/zipline/utils/range.py
imports: import operator
  from six import PY2
  from toolz import peek
  from zipline.utils.functional import foldr
label_desc: Use image node_id 7 for calling a global function with example usage: group_ranges(ranges) and returns: foldr