code: def test_webdataset_read(ray_start_2_cpus, tmp_path):
      path = os.path.join(tmp_path, "bar_000000.tar")
      with TarWriter(path) as tf:
          for i in range(100):
              tf.write(f"{i}.a", str(i).encode("utf-8"))
              tf.write(f"{i}.b", str(i**2).encode("utf-8"))
      assert os.path.exists(path)
      assert len(glob.glob(f"{tmp_path}/*.tar")) == 1
      ds = ray.data.read_webdataset(
          paths=[str(tmp_path)], parallelism=1
      )
      samples = ds.take(100)
      assert len(samples) == 100
      for i, sample in enumerate(samples):
          assert isinstance(sample, dict), sample
          assert sample["__key__"] == str(i)
          assert sample["a"].decode("utf-8") == str(i)
          assert sample["b"].decode("utf-8") == str(i**2)
  
file_path: ray/python/ray/data/tests/test_webdataset.py
imports: import glob
  import io
  import os
  import tarfile
  import pytest
  import ray
  from ray.tests.conftest import *
label_desc: Use image node_id 1 for calling a global function with example usage: test_webdataset_read(ray_start_2_cpus, tmp_path) without return types