def METHOD_NAME(
    storage: Storage, cobj: CloudObject, ranges: Union[List[Tuple[int, int]], np.ndarray]
) -> List[bytes]:
    """Download partial ranges from a CloudObject. This combines adjacent/overlapping ranges
    to minimize the number of requests without wasting any bandwidth if there are large gaps
    between requested ranges."""
    max_jump = 2 ** 16  # Largest gap between ranges before a new request should be made
    # Limit chunks to 256MB to avoid large memory allocations, and because SSL fails if requests
    # are >2GB https://bugs.python.org/issue42853 (Fixed in Python 3.9.7, broken in 3.8.*)
    max_chunk_size = 256 * 2 ** 20
    request_ranges: List[Tuple[int, int]] = []
    tasks = []
    range_start = None
    range_end = None
    for input_i in np.argsort(np.array(ranges)[:, 0]):
        lo_idx, hi_idx = ranges[input_i]
        if range_start is None:
            range_start, range_end = lo_idx, hi_idx
        elif lo_idx - range_end <= max_jump and range_end - range_start <= max_chunk_size:
            range_end = max(range_end, hi_idx)
        else:
            request_ranges.append((range_start, range_end))
            range_start, range_end = lo_idx, hi_idx
        tasks.append((input_i, len(request_ranges), lo_idx - range_start, hi_idx - range_start))
    if range_start is not None and range_end is not None:
        request_ranges.append((range_start, range_end))  # type: ignore
    logger.debug(f'Reading {len(request_ranges)} ranges: {request_ranges}')
    with ThreadPoolExecutor() as executor:
        def get_range(lo_hi):
            lo_idx, hi_idx = lo_hi
            args = {'Range': f'bytes={lo_idx}-{hi_idx-1}'}
            return storage.get_object(cobj.bucket, cobj.key, extra_get_args=args)
        request_results = list(executor.map(get_range, request_ranges))
    return [
        request_results[request_i][request_lo:request_hi]
        for input_i, request_i, request_lo, request_hi in sorted(tasks)
    ]