def METHOD_NAME(asdf_file):
    with pytest.raises(ValueError, match=r"filter must accept 1 or 2 arguments"):
        asdf_file.search(filter_=lambda: True)
    result = asdf_file.search(filter_=lambda n: isinstance(n, int) and n % 2 == 0)
    assert result.nodes == [42, 24, 24, 0, 2]
    result = asdf_file.search(filter_=lambda n, k: k == "foo" and n > 30)
    assert result.node == 42