code: def test_readback_tfrecords(
      ray_start_regular_shared,
      tmp_path,
      with_tf_schema,
  ):
      """
      Test reading back TFRecords written using datasets.
      The dataset we read back should be the same that we wrote.
      """
  
      # The dataset we will write to a .tfrecords file.
      # Here and in the read_tfrecords call below, we specify `parallelism=1`
      # to ensure that all rows end up in the same block, which is required
      # for type inference involving partially missing columns.
      ds = ray.data.from_items(
          data_partial(with_tf_schema), parallelism=1
      )
      expected_records = tf_records_partial()
  
      tf_schema = None
      if with_tf_schema:
          features = expected_records[0].features
          tf_schema = _features_to_schema(features)
  
      # Write the TFRecords.
      ds.write_tfrecords(tmp_path, tf_schema=tf_schema)
      # Read the TFRecords.
      readback_ds = ray.data.read_tfrecords(
          tmp_path, tf_schema=tf_schema, parallelism=1
      )
      _ds_eq_streaming(ds, readback_ds)
  
imports: import json
  import os
  from typing import TYPE_CHECKING
  import numpy
  import pytest
  from pandas.api.types import is_float_dtype, is_int64_dtype, is_object_dtype
  import ray
  from ray.tests.conftest import *
label_desc: Use image node_id 11 for calling a global function with example usage: test_readback_tfrecords(ray_start_regular_shared, tmp_path, with_tf_schema) without return types