code: def create_and_validate(length, size):
      dataset = DummyDataset(length, size)
  
      with NamedTemporaryFile() as handle:
          name = handle.name
          writer = DatasetWriter(
              name,
              {"index": IntField(), "value": BytesField()},
              num_workers=2,
          )
  
          writer.from_indexed_dataset(dataset, chunksize=5)
  
          reader = Reader(name)
  
          assert_that(reader.handlers).is_length(2)
          assert_that(reader.handlers["index"]).is_instance_of(IntField)
          assert_that(reader.handlers["value"]).is_instance_of(
              BytesField
          )
          assert_that(reader.alloc_table).is_length(length)
          assert_that(reader.metadata).is_length(length)
          assert_that(
              (
                  reader.metadata["f0"]
                  == np.arange(length).astype("int")
              ).all()
          ).is_true()
  
          assert_that(
              np.all(reader.alloc_table["size"] == size)
          ).is_true()
  
file_path: ffcv/tests/test_memory_allocation.py
imports: import numpy
  from assertpy import assert_that
  from torch.utils.data import Dataset
  import logging
  import os
  from assertpy import assert_that
  from tempfile import NamedTemporaryFile
  from ffcv.writer import DatasetWriter
  from ffcv.reader import Reader
  from ffcv.fields import BytesField, IntField
label_desc: Use image node_id 1 for calling a global function with example usage: create_and_validate(length, size) without return types