code: def test_tensor_array_reductions():
      outer_dim = 3
      inner_shape = (2, 2, 2)
      shape = (outer_dim,) + inner_shape
      num_items = np.prod(np.array(shape))
      arr = np.arange(num_items).reshape(shape)
  
      df = pd.DataFrame(
          {"one": list(range(outer_dim)), "two": TensorArray(arr)}
      )
  
      # Reduction tests, using NumPy as the groundtruth.
      for name, reducer in TensorArray.SUPPORTED_REDUCERS.items():
          np_kwargs = {}
          if name in ("std", "var"):
              # Pandas uses a ddof default of 1 while NumPy uses 0.
              # Give NumPy a ddof kwarg of 1 in order to ensure equivalent
              # standard deviation calculations.
              np_kwargs["ddof"] = 1
          np.testing.assert_equal(
              df["two"].agg(name), reducer(arr, axis=0, **np_kwargs)
          )
  
imports: import itertools
  import numpy
  import pandas
  from packaging.version import parse
  import pyarrow
  import pytest
  from ray.air.util.tensor_extensions.arrow import ArrowTensorArray, ArrowTensorType, ArrowVariableShapedTensorArray, ArrowVariableShapedTensorType
  from ray.air.util.tensor_extensions.pandas import TensorArray, TensorDtype
  from ray.air.util.tensor_extensions.utils import create_ragged_ndarray
  from ray._private.utils import _get_pyarrow_version
label_desc: Use image node_id 19 for calling a global function with example usage: test_tensor_array_reductions() without return types