code: def test_parquet_reader_estimate_data_size(shutdown_only, tmp_path):
      ctx = ray.data.context.DataContext.get_current()
      old_decoding_size_estimation = ctx.decoding_size_estimation
      ctx.decoding_size_estimation = True
      try:
          tensor_output_path = os.path.join(tmp_path, "tensor")
          ray.data.range_tensor(1000, shape=(1000,)).write_parquet(
              tensor_output_path
          )
          ds = ray.data.read_parquet(tensor_output_path)
          assert ds.num_blocks() > 1
          data_size = ds.size_bytes()
          assert (
              data_size >= 6_000_000 and data_size <= 10_000_000
          ), "estimated data size is out of expected bound"
          data_size = ds.materialize().size_bytes()
          assert (
              data_size >= 7_000_000 and data_size <= 10_000_000
          ), "actual data size is out of expected bound"
  
          datasource = ParquetDatasource(tensor_output_path)
          assert (
              datasource._encoding_ratio >= 300
              and datasource._encoding_ratio <= 600
          ), "encoding ratio is out of expected bound"
          data_size = datasource.estimate_inmemory_data_size()
          assert (
              data_size >= 6_000_000 and data_size <= 10_000_000
          ), "estimated data size is either out of expected bound"
          assert (
              data_size
              == ParquetDatasource(
                  tensor_output_path
              ).estimate_inmemory_data_size()
          ), "estimated data size is not deterministic in multiple calls."
  
          text_output_path = os.path.join(tmp_path, "text")
          ray.data.range(1000).map(
              lambda _: {"text": "a" * 1000}
          ).write_parquet(text_output_path)
          ds = ray.data.read_parquet(text_output_path)
          assert ds.num_blocks() > 1
          data_size = ds.size_bytes()
          assert (
              data_size >= 1_000_000 and data_size <= 2_000_000
          ), "estimated data size is out of expected bound"
          data_size = ds.materialize().size_bytes()
          assert (
              data_size >= 1_000_000 and data_size <= 2_000_000
          ), "actual data size is out of expected bound"
  
          datasource = ParquetDatasource(text_output_path)
          assert (
              datasource._encoding_ratio >= 150
              and datasource._encoding_ratio <= 300
          ), "encoding ratio is out of expected bound"
          data_size = datasource.estimate_inmemory_data_size()
          assert (
              data_size >= 1_000_000 and data_size <= 2_000_000
          ), "estimated data size is out of expected bound"
          assert (
              data_size
              == ParquetDatasource(
                  text_output_path
              ).estimate_inmemory_data_size()
          ), "estimated data size is not deterministic in multiple calls."
      finally:
          ctx.decoding_size_estimation = old_decoding_size_estimation
  
imports: import os
  import shutil
  from typing import Any
  import numpy
  import pandas
  import pyarrow
  import pyarrow.parquet
  import pytest
  from pytest_lazyfixture import lazy_fixture
  import ray
  from ray.data.block import BlockAccessor
  from ray.data.context import DataContext
  from ray.data.datasource import DefaultFileMetadataProvider, DefaultParquetMetadataProvider
  from ray.data.datasource.parquet_base_datasource import ParquetBaseDatasource
  from ray.data.datasource.parquet_datasource import NUM_CPUS_FOR_META_FETCH_TASK, PARALLELIZE_META_FETCH_THRESHOLD, RETRY_EXCEPTIONS_FOR_META_FETCH_TASK, ParquetDatasource, _deserialize_fragments_with_retry, _SerializedFragment
  from ray.data.datasource.path_util import _unwrap_protocol
  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 16 for calling a global function with example usage: test_parquet_reader_estimate_data_size(shutdown_only, tmp_path) without return types