code: def test_join_left(
      left_nrows, right_nrows, left_nkeys, right_nkeys, how
  ):
      chunksize = 50
  
      np.random.seed(0)
  
      # cuDF
      left = cudf.DataFrame(
          {
              "x": np.random.randint(0, left_nkeys, size=left_nrows),
              "a": np.arange(left_nrows, dtype=np.float64),
          }
      )
      right = cudf.DataFrame(
          {
              "x": np.random.randint(0, right_nkeys, size=right_nrows),
              "a": 1000 * np.arange(right_nrows, dtype=np.float64),
          }
      )
  
      expect = left.set_index("x").join(
          right.set_index("x"),
          how=how,
          sort=True,
          lsuffix="l",
          rsuffix="r",
      )
      expect = expect.to_pandas()
  
      # dask_cudf
      left = dgd.from_cudf(left, chunksize=chunksize)
      right = dgd.from_cudf(right, chunksize=chunksize)
  
      joined = left.set_index("x").join(
          right.set_index("x"), how=how, lsuffix="l", rsuffix="r"
      )
      got = joined.compute().to_pandas()
  
      if len(got.columns):
          got = got.sort_values(list(got.columns))
          expect = expect.sort_values(list(expect.columns))
  
      # Check index
      np.testing.assert_array_equal(
          expect.index.values, got.index.values
      )
  
      # Check rows in each groups
      expect_rows = {}
      got_rows = {}
  
      def gather(df, grows):
          cola = np.sort(np.asarray(df.al))
          colb = np.sort(np.asarray(df.ar))
  
          grows[df["x"].values[0]] = (cola, colb)
  
      expect.reset_index().groupby("x").apply(
          partial(gather, grows=expect_rows)
      )
  
      expect.reset_index().groupby("x").apply(
          partial(gather, grows=got_rows)
      )
  
      for k in expect_rows:
          np.testing.assert_array_equal(
              expect_rows[k][0], got_rows[k][0]
          )
          np.testing.assert_array_equal(
              expect_rows[k][1], got_rows[k][1]
          )
  
file_path: cudf/python/dask_cudf/dask_cudf/tests/test_join.py
imports: from functools import partial
  import numpy
  import pandas
  import pytest
  from dask import dataframe
  import cudf
  import dask_cudf
label_desc: Use image node_id 2 for calling a global function with example usage: test_join_left(left_nrows, right_nrows, left_nkeys, right_nkeys, how) without return types