code: def run_test(n_samples):
      with NamedTemporaryFile() as handle:
          name = handle.name
          dataset = DummyDictDataset(n_samples)
          writer = DatasetWriter(
              name,
              {"index": IntField(), "activations": JSONField()},
              num_workers=min(3, cpu_count()),
          )
  
          writer.from_indexed_dataset(dataset)
  
          loader = Loader(
              name,
              batch_size=3,
              num_workers=min(5, cpu_count()),
              pipelines={
                  "activations": [BytesDecoder()],
                  "index": [IntDecoder()],
              },
          )
          ix = 0
          for _, json_encoded in loader:
              json_docs = JSONField.unpack(json_encoded)
              for doc in json_docs:
                  ref_doc = dataset[ix][1]
                  assert_that(sorted(doc.items())).is_equal_to(
                      sorted(ref_doc.items())
                  )
                  ix += 1
  
imports: import string
  from ctypes import pointer
  from tempfile import NamedTemporaryFile
  from collections import defaultdict
  from multiprocessing import cpu_count
  from assertpy import assert_that
  import numpy
  from torch.utils.data import Dataset
  from ffcv import DatasetWriter
  from ffcv.fields import IntField, JSONField
  from ffcv.fields.bytes import BytesDecoder
  from ffcv.fields.basics import IntDecoder
  from ffcv import Loader
label_desc: Use image node_id 2 for calling a global function with example usage: run_test(n_samples) without return types