code: def test_to_filter():
      f1 = to_filter(True)
      f2 = to_filter(False)
      f3 = to_filter(Condition(lambda: True))
      f4 = to_filter(Condition(lambda: False))
  
      assert isinstance(f1, Filter)
      assert isinstance(f2, Filter)
      assert isinstance(f3, Filter)
      assert isinstance(f4, Filter)
      assert f1()
      assert not f2()
      assert f3()
      assert not f4()
  
      with pytest.raises(TypeError):
          to_filter(4)
  
file_path: catboost/contrib/python/prompt-toolkit/py3/tests/test_filter.py
imports: from __future__ import annotations
  import pytest
  from prompt_toolkit.filters import Always, Condition, Filter, Never, to_filter
  from prompt_toolkit.filters.base import _AndList, _OrList
label_desc: Use image node_id 8 for calling a global function with example usage: test_to_filter() without return types