code: def find_partitions(table, boundaries, sort_key):
      partitions = []
  
      # For each boundary value, count the number of items that are less
      # than it. Since the block is sorted, these counts partition the items
      # such that boundaries[i] <= x < boundaries[i + 1] for each x in
      # partition[i]. If `descending` is true, `boundaries` would also be
      # in descending order and we only need to count the number of items
      # *greater than* the boundary value instead.
      bounds = [
          find_partition_index(table, boundary, sort_key)
          for boundary in boundaries
      ]
  
      last_idx = 0
      for idx in bounds:
          partitions.append(table[last_idx:idx])
          last_idx = idx
      partitions.append(table[last_idx:])
      return partitions
  
imports: import importlib
  import logging
  import os
  import pathlib
  import random
  import sys
  import threading
  import time
  import urllib.parse
  from collections import deque
  from types import ModuleType
  from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, Iterator, List, Optional, Tuple, TypeVar, Union
  import numpy
  import ray
  from ray._private.utils import _get_pyarrow_version
  from ray.data._internal.arrow_ops.transform_pyarrow import unify_schemas
  from ray.data.context import WARN_PREFIX, DataContext
label_desc: Use image node_id 26 for calling a global function with example usage: find_partitions(table, boundaries, sort_key) and returns: partitions