code: def write_webdataset(folder, dataset, field_names):
      pattern = path.join(folder, "dataset-%06d.tar")
      writer = wds.ShardWriter(pattern, maxcount=20)
      with writer as sink:
          for i, sample in enumerate(dataset):
              data = {"__key__": f"sample_{i}"}
  
              for field_name, value in zip(field_names, sample):
                  data[field_name] = value
              sink.write(data)
  
file_path: ffcv/tests/test_webdataset.py
imports: from os import path
  from glob import glob
  import tempfile
  import numpy
  from tempfile import TemporaryDirectory, NamedTemporaryFile
  import torch
  from torch.utils.data import Dataset
  import webdataset
  from ffcv import DatasetWriter
  from ffcv.reader import Reader
  from ffcv.fields import IntField, FloatField
  from test_writer import validate_simple_dataset
label_desc: Use image node_id 1 for calling a global function with example usage: write_webdataset(folder, dataset, field_names) without return types