code: def test_feature_names_filtered():
      filtered, indices = FeatureNames(
          ["one", "two", "twenty-two"]
      ).filtered(lambda name: "two" in name)
      assert indices == [1, 2]
      assert list(filtered) == ["two", "twenty-two"]
  
      filtered, indices = FeatureNames(
          {1: "two", 3: "twenty-two", 5: "two-thirds"},
          unkn_template="%d",
          n_features=6,
          bias_name="foo",
      ).filtered(lambda name: name.startswith("two"))
      assert indices == [1, 5]
      assert filtered.bias_name is None
      assert filtered.unkn_template == "%d"
      assert list(filtered) == ["two", "two-thirds"]
  
      filtered, indices = FeatureNames(
          ["a", "b"], bias_name="bias"
      ).filtered(lambda name: "b" in name)
      assert indices == [1, 2]
      assert filtered.bias_name == "bias"
      assert list(filtered) == ["b", "bias"]
  
      filtered, indices = FeatureNames(
          unkn_template="x%d", n_features=6
      ).filtered(lambda name: False)
      assert indices == []
  
      filtered, indices = FeatureNames(
          ["one", "two", "twenty-two"]
      ).filtered(
          lambda name, value: "t" in name and value <= 1, x=[0, 1, 2]
      )
      assert indices == [1]
      assert list(filtered) == ["two"]
  
file_path: eli5/tests/test_feature_names.py
imports: import pytest
  import numpy
  from eli5._feature_names import FeatureNames
label_desc: Use image node_id 1 for calling a global function with example usage: test_feature_names_filtered() without return types