code: def validate_simple_dataset(name, length, shuffled=False):
      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(FloatField)
      assert_that(reader.alloc_table).is_length(0)
      assert_that(reader.metadata).is_length(length)
      if shuffled:
          assert_that(
              (
                  reader.metadata["f0"]
                  == np.arange(length).astype("int")
              ).all()
          ).is_false()
          assert_that(set(reader.metadata["f0"])).is_equal_to(
              set(np.arange(length).astype("int"))
          )
      else:
          assert_that(
              (
                  reader.metadata["f0"]
                  == np.arange(length).astype("int")
              ).all()
          ).is_true()
      assert_that(
          (np.sin(reader.metadata["f0"]) == reader.metadata["f1"]).all()
      ).is_true()
  
imports: import numpy
  from assertpy import assert_that
  from numpy.random import shuffle
  from torch.utils.data import Dataset
  import logging
  import os
  from assertpy import assert_that
  from tempfile import NamedTemporaryFile
  from multiprocessing import cpu_count
  from ffcv.writer import DatasetWriter
  from ffcv.reader import Reader
  from ffcv.fields import IntField, FloatField, BytesField
label_desc: Use image node_id 1 for calling a global function with example usage: validate_simple_dataset(name, length, shuffled) without return types