code: def test_basic_simple():
      length = 600
      batch_size = 8
      with NamedTemporaryFile() as handle:
          file_name = handle.name
          dataset = DummyDataset(length)
          writer = DatasetWriter(
              file_name, {"index": IntField(), "value": FloatField()}
          )
  
          writer.from_indexed_dataset(dataset)
  
          Compiler.set_enabled(True)
  
          loader = Loader(
              file_name,
              batch_size,
              num_workers=min(5, cpu_count()),
              seed=17,
              pipelines={
                  "value": [FloatDecoder(), Doubler(), ToTensor()],
              },
          )
  
          def cond(value):
              value = value[0]
              result = value < 1 and value >= 0.5
              return result
  
          filtered = loader.filter("value", cond)
  
          assert_that(len(filtered)).is_greater_than(0)
          for index, values in filtered:
              assert_that(values.shape[0]).is_equal_to(batch_size)
              assert_that(
                  ((values < 1) & (values >= 0.5)).all()
              ).is_true()
  
imports: from dataclasses import replace
  import torch
  from ffcv.pipeline.allocation_query import AllocationQuery
  from ffcv.pipeline.compiler import Compiler
  import numpy
  from typing import Callable
  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.pipeline.operation import Operation
  from ffcv.transforms.ops import ToTensor
  from multiprocessing import cpu_count
  from ffcv.writer import DatasetWriter
  from ffcv.reader import Reader
  from ffcv.loader import Loader
  from ffcv.fields import IntField, FloatField, BytesField
  from ffcv.fields.basics import FloatDecoder
  from ffcv.pipeline.state import State
  from test_writer import DummyDataset
label_desc: Use image node_id 1 for calling a global function with example usage: test_basic_simple() and returns: result