code: def test_apply_filter_on_example():
      def a_is_even(example) -> bool:
          return example["a"] % 2 == 0
  
      apply_filter_fn = transform_lib.apply_filter(
          fn=a_is_even, input_feature=""
      )
      assert list(apply_filter_fn(example={"a": 2}))
      assert not list(apply_filter_fn(example={"a": 1}))
  
file_path: datasets/tensorflow_datasets/core/transform/transform_lib_test.py
imports: import functools
  from typing import Iterator
  import pytest
  from tensorflow_datasets.core.transform import transform_lib
label_desc: Use image node_id 10 for calling a global function with example usage: test_apply_filter_on_example() and returns: unknown