code: def test_partitioning(
      self,
      ray_start_regular_shared,
      enable_automatic_tensor_extension_cast,
  ):
      root = "example://image-datasets/dir-partitioned"
      partitioning = Partitioning(
          "dir", base_dir=root, field_names=["label"]
      )
  
      ds = ray.data.read_images(root, partitioning=partitioning)
  
      assert ds.schema().names == ["image", "label"]
  
      image_type, label_type = ds.schema().types
      assert isinstance(image_type, ArrowTensorType)
      assert pa.types.is_string(label_type)
  
      df = ds.to_pandas()
      assert sorted(df["label"]) == ["cat", "cat", "dog"]
      if enable_automatic_tensor_extension_cast:
          assert all(
              tensor.shape == (32, 32, 3) for tensor in df["image"]
          )
      else:
          assert all(
              tensor.numpy_shape == (32, 32, 3)
              for tensor in df["image"]
          )
  
imports: import os
  import tempfile
  from typing import Dict
  import numpy
  import pyarrow
  import pytest
  from fsspec.implementations.local import LocalFileSystem
  from PIL import Image
  import ray
  from ray.data.datasource import Partitioning
  from ray.data.datasource.file_meta_provider import FastFileMetadataProvider
  from ray.data.datasource.image_datasource import ImageDatasource, _ImageFileMetadataProvider
  from ray.data.extensions import ArrowTensorType
  from ray.data.tests.conftest import *
  from ray.data.tests.mock_http_server import *
  from ray.tests.conftest import *
label_desc: Use image node_id 11 for calling the TestReadImages obj's underlying member method code with example usage: obj.test_partitioning(ray_start_regular_shared, enable_automatic_tensor_extension_cast) without return types