code: def test_data_size_estimate(
      self,
      ray_start_regular_shared,
      image_size,
      image_mode,
      expected_size,
      expected_ratio,
  ):
      root = "example://image-datasets/different-sizes"
      ds = ray.data.read_images(
          root,
          size=(image_size, image_size),
          mode=image_mode,
          parallelism=1,
      )
  
      data_size = ds.size_bytes()
      assert (
          data_size >= 0
      ), "estimated data size is out of expected bound"
      data_size = ds.materialize().size_bytes()
      assert data_size >= 0, "actual data size is out of expected bound"
  
      datasource = ImageDatasource(
          paths=[root],
          size=(image_size, image_size),
          mode=image_mode,
          filesystem=LocalFileSystem(),
          partitioning=None,
          meta_provider=_ImageFileMetadataProvider(),
      )
      assert (
          datasource._encoding_ratio >= expected_ratio
          and datasource._encoding_ratio <= expected_ratio * 1.5
      ), "encoding ratio is out of expected bound"
      data_size = datasource.estimate_inmemory_data_size()
      assert (
          data_size >= 0
      ), "estimated data size is out of expected bound"
  
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 14 for calling the TestReadImages obj's underlying member method code with example usage: obj.test_data_size_estimate(ray_start_regular_shared, image_size, image_mode, expected_size, expected_ratio) without return types