code: def test_rearrange_by_divisions(nelem, index):
      with dask.config.set(scheduler="single-threaded"):
          np.random.seed(0)
          df = pd.DataFrame(
              {
                  "x": np.random.randint(0, 20, size=nelem),
                  "y": np.random.normal(size=nelem),
                  "z": np.random.choice(["dog", "cat", "bird"], nelem),
              }
          )
          df["z"] = df["z"].astype("category")
  
          ddf1 = dd.from_pandas(df, npartitions=4)
          gdf1 = dgd.from_cudf(
              cudf.DataFrame.from_pandas(df), npartitions=4
          )
          ddf1.index.name = index
          gdf1.index.name = index
          divisions = (0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20)
  
          expect = dd.shuffle.rearrange_by_divisions(
              ddf1, "x", divisions=divisions, shuffle_method="tasks"
          )
          result = dd.shuffle.rearrange_by_divisions(
              gdf1, "x", divisions=divisions, shuffle_method="tasks"
          )
          dd.assert_eq(expect, result)
  
imports: import random
  import cupy
  import numpy
  import pandas
  import pytest
  from packaging import version
  import dask
  from dask import dataframe
  from dask.dataframe.core import make_meta, meta_nonempty
  from dask.utils import M
  import cudf
  import dask_cudf
label_desc: Use image node_id 18 for calling a global function with example usage: test_rearrange_by_divisions(nelem, index) without return types