code: def test_cumprod(dtype, nelem):
      if dtype == np.int8:
          # to keep data in range
          data = gen_rand(dtype, nelem, low=-2, high=2)
      else:
          data = gen_rand(dtype, nelem)
  
      decimal = 4 if dtype == np.float32 else 6
  
      # series
      gs = cudf.Series(data)
      ps = pd.Series(data)
      np.testing.assert_array_almost_equal(
          gs.cumprod().to_numpy(), ps.cumprod(), decimal=decimal
      )
  
      # dataframe series (named series)
      gdf = cudf.DataFrame()
      gdf["a"] = cudf.Series(data)
      pdf = pd.DataFrame()
      pdf["a"] = pd.Series(data)
      np.testing.assert_array_almost_equal(
          gdf.a.cumprod().to_numpy(), pdf.a.cumprod(), decimal=decimal
      )
  
imports: from itertools import product
  import numpy
  import pandas
  import pytest
  import cudf
  from cudf.core.dtypes import Decimal32Dtype, Decimal64Dtype, Decimal128Dtype
  from cudf.testing._utils import INTEGER_TYPES, NUMERIC_TYPES, assert_eq, gen_rand
label_desc: Use image node_id 11 for calling a global function with example usage: test_cumprod(dtype, nelem) without return types