code: def test_filter_dataset_on_len(self):
      # {1, 2}, {2, 4}, {3, 6} ... {10, 20}
      ds = _test_dataset_ints(range(1, 11), range(2, 21, 2))
  
      ds1 = tf_inputs.filter_dataset_on_len(
          ds, True, {"inputs": [4, 8], "targets": [14, 20]}
      )
      # Only {7, 14} and {8, 16} satisfy this.
      self.assertLen(list(ds1.as_numpy_iterator()), 2)
  
      ds2 = tf_inputs.filter_dataset_on_len(
          ds,
          False,
          len_map={"inputs": [4, 8], "targets": [14, 20]},
          filter_on_eval=False,
      )
      # This is eval and we aren't supposed to filter it.
      self.assertLen(list(ds2.as_numpy_iterator()), 10)
  
      ds3 = tf_inputs.filter_dataset_on_len(
          ds,
          False,
          len_map={"inputs": [4, 8], "targets": [14, 20]},
          filter_on_eval=True,
      )
      # This is eval and we are asked to filter it.
      self.assertLen(list(ds3.as_numpy_iterator()), 2)
  
imports: import collections
  import os
  from unittest import mock
  import gin
  import numpy
  from t5.data import assert_dataset
  from t5.data import preprocessors
  import tensorflow
  import tensorflow_datasets
  from trax.data import inputs
  from trax.data import tf_inputs
label_desc: Use image node_id 18 for calling the TFInputsTest obj's underlying member method code with example usage: obj.test_filter_dataset_on_len() without return types