code: def test_trapz_execution(setup):
      raws = [np.random.rand(10), np.random.rand(10, 3)]
  
      for raw in raws:
          for chunk_size in (4, 10):
              for dx in (1.0, 2.0):
                  t = tensor(raw, chunk_size=chunk_size)
                  r = trapz(t, dx=dx)
  
                  result = r.execute().fetch()
                  expected = np.trapz(raw, dx=dx)
                  np.testing.assert_almost_equal(
                      result,
                      expected,
                      err_msg=f"failed when raw={raw}, "
                      f"chunk_size={chunk_size}, dx={dx}",
                  )
  
      # test x not None
      raw_ys = [np.random.rand(10), np.random.rand(10, 3)]
      raw_xs = [np.random.rand(10), np.random.rand(10, 3)]
  
      for raw_y, raw_x in zip(raw_ys, raw_xs):
          ys = [
              tensor(raw_y, chunk_size=5),
              tensor(raw_y, chunk_size=10),
          ]
          x = tensor(raw_x, chunk_size=4)
  
          for y in ys:
              r = trapz(y, x=x)
  
              result = r.execute().fetch()
              expected = np.trapz(raw_y, x=raw_x)
              np.testing.assert_almost_equal(result, expected)
  
imports: import numpy
  import scipy.sparse
  import pandas
  import pytest
  from ....None import dataframe
  from ....None import tensor
  from ....None import execute, fetch
  from ....tests.core import require_cupy
  from ...datasource import tensor, ones, zeros, arange
  from ..None import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, diff, ediff1d, flip, flipud, fliplr, repeat, tile, isin, searchsorted, unique, sort, argsort, partition, argpartition, topk, argtopk, trapz, shape, to_gpu, to_cpu, swapaxes
label_desc: Use image node_id 43 for calling a global function with example usage: test_trapz_execution(setup) without return types