code: def test_arrow_tensor_pandas(cast_tensor_columns):
      np_array = np.arange(12).reshape((3, 2, 2))
      input_data = pa.Table.from_arrays(
          [ArrowTensorArray.from_numpy(np_array)], names=["x"]
      )
      actual_output = _convert_batch_type_to_pandas(
          input_data, cast_tensor_columns
      )
      expected_output = pd.DataFrame({"x": list(np_array)})
      expected_output = pd.DataFrame(
          {
              "x": (
                  list(np_array)
                  if cast_tensor_columns
                  else TensorArray(np_array)
              )
          }
      )
      pd.testing.assert_frame_equal(expected_output, actual_output)
  
      arrow_output = _convert_pandas_to_batch_type(
          actual_output,
          type=BatchFormat.ARROW,
          cast_tensor_columns=cast_tensor_columns,
      )
      assert arrow_output.equals(input_data)
  
imports: import pytest
  import warnings
  import pandas
  import numpy
  import pyarrow
  from ray.air._internal.torch_utils import convert_ndarray_to_torch_tensor
  from ray.air.constants import TENSOR_COLUMN_NAME
  from ray.air.util.data_batch_conversion import _convert_batch_type_to_pandas, _convert_pandas_to_batch_type, _convert_batch_type_to_numpy, _cast_ndarray_columns_to_tensor_extension, _cast_tensor_columns_to_ndarrays
  from ray.air.util.data_batch_conversion import BatchFormat
  from ray.air.util.tensor_extensions.pandas import TensorArray
  from ray.air.util.tensor_extensions.arrow import ArrowTensorArray
label_desc: Use image node_id 16 for calling a global function with example usage: test_arrow_tensor_pandas(cast_tensor_columns) without return types