code: def create_and_run(num_samples, size_bytes):
      handle = NamedTemporaryFile()
      with handle:
          name = handle.name
          dataset = DummyDataset(num_samples, size_bytes)
          writer = DatasetWriter(
              num_samples,
              name,
              {"index": IntField(), "value": BytesField()},
          )
  
          Compiler.set_enabled(True)
  
          with writer:
              writer.write_pytorch_dataset(
                  dataset, num_workers=-1, chunksize=100
              )
          total_dataset_size = num_samples * size_bytes
          # Dataset should not be in RAM
          process = psutil.Process(os.getpid())
          assert_that(process.memory_info().rss).is_less_than(
              total_dataset_size
          )
  
          loader = Loader(name, 128, 10)
          for _ in tqdm(loader):
              assert_that(process.memory_info().rss).is_less_than(
                  total_dataset_size
              )
  
imports: import os
  from tempfile import NamedTemporaryFile
  from time import sleep, time
  import os, psutil
  import numpy
  import pytest
  from tqdm import tqdm
  from assertpy import assert_that
  from torch.utils.data import Dataset
  from ffcv.writer import DatasetWriter
  from ffcv.reader import Reader
  from ffcv.fields import BytesField, IntField
  from ffcv.pipeline.compiler import Compiler
  from ffcv import Loader
label_desc: Use image node_id 1 for calling a global function with example usage: create_and_run(num_samples, size_bytes) without return types