code: def test_webdataset_write(ray_start_2_cpus, tmp_path):
      print(ray.available_resources())
      data = [
          dict(__key__=str(i), a=str(i), b=str(i**2))
          for i in range(100)
      ]
      ds = ray.data.from_items(data).repartition(1)
      ds.write_webdataset(path=tmp_path, try_create_dir=True)
      paths = glob.glob(f"{tmp_path}/*.tar")
      assert len(paths) == 1
      with open(paths[0], "rb") as stream:
          tf = tarfile.open(fileobj=stream)
          for i in range(100):
              assert tf.extractfile(f"{i}.a").read().decode(
                  "utf-8"
              ) == str(i)
              assert tf.extractfile(f"{i}.b").read().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 3 for calling a global function with example usage: test_webdataset_write(ray_start_2_cpus, tmp_path) without return types