code: def _merge_ranges(byte_ranges, max_block=256_000_000, max_gap=64_000):
      # Simple utility to merge small/adjacent byte ranges
      new_ranges = []
      if not byte_ranges:
          # Early return
          return new_ranges
  
      offset, size = byte_ranges[0]
      for new_offset, new_size in byte_ranges[1:]:
          gap = new_offset - (offset + size)
          if gap > max_gap or (size + new_size + gap) > max_block:
              # Gap is too large or total read is too large
              new_ranges.append((offset, size))
              offset = new_offset
              size = new_size
              continue
          size += new_size + gap
      new_ranges.append((offset, size))
      return new_ranges
  
imports: import datetime
  import os
  import urllib
  import warnings
  from io import BufferedWriter, BytesIO, IOBase, TextIOWrapper
  from threading import Thread
  import fsspec
  import fsspec.implementations.local
  import numpy
  import pandas
  from fsspec.core import get_fs_token_paths
  from pyarrow import PythonFile
  from pyarrow.lib import NativeFile
  from cudf.utils.docutils import docfmt_partial
label_desc: Use image node_id 22 for calling a global function with example usage: _merge_ranges(byte_ranges, max_block, max_gap) and returns: new_ranges, new_ranges