code: def test_tensors_in_tables_iter_batches(
      ray_start_regular_shared,
      enable_automatic_tensor_extension_cast,
  ):
      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)
      df1 = pd.DataFrame(
          {
              "one": TensorArray(arr),
              "two": TensorArray(arr + 1),
              "label": [1.0, 2.0, 3.0],
          }
      )
      arr2 = np.arange(num_items, 2 * num_items).reshape(shape)
      df2 = pd.DataFrame(
          {
              "one": TensorArray(arr2),
              "two": TensorArray(arr2 + 1),
              "label": [4.0, 5.0, 6.0],
          }
      )
      df = pd.concat([df1, df2], ignore_index=True)
      if enable_automatic_tensor_extension_cast:
          df.loc[:, "one"] = list(df["one"].to_numpy())
          df.loc[:, "two"] = list(df["two"].to_numpy())
      ds = ray.data.from_pandas([df1, df2])
      batches = list(
          ds.iter_batches(batch_size=2, batch_format="pandas")
      )
      assert len(batches) == 3
      expected_batches = [df.iloc[:2], df.iloc[2:4], df.iloc[4:]]
      for batch, expected_batch in zip(batches, expected_batches):
          batch = batch.reset_index(drop=True)
          expected_batch = expected_batch.reset_index(drop=True)
          pd.testing.assert_frame_equal(batch, expected_batch)
  
imports: import time
  import numpy
  import pandas
  import pyarrow
  import pytest
  import ray
  from ray.air.util.tensor_extensions.utils import _create_possibly_ragged_ndarray
  from ray.data.block import BlockAccessor
  from ray.data.extensions.tensor_extension import ArrowTensorArray, ArrowTensorType, ArrowVariableShapedTensorArray, ArrowVariableShapedTensorType, TensorArray, TensorDtype
  from ray.data.tests.conftest import *
  from ray.data.tests.util import extract_values
  from ray.tests.conftest import *
label_desc: Use image node_id 21 for calling a global function with example usage: test_tensors_in_tables_iter_batches(ray_start_regular_shared, enable_automatic_tensor_extension_cast) without return types