code: def test_filter_remove_duplicates():
      cond1 = Condition(lambda: True)
      cond2 = Condition(lambda: True)
  
      # When a condition is appended to itself using an `&` or `|` operator, it
      # should not be present twice. Having it twice in the `_AndList` or
      # `_OrList` will make them more expensive to evaluate.
  
      assert isinstance(cond1 & cond1, Condition)
      assert isinstance(cond1 & cond1 & cond1, Condition)
      assert isinstance(cond1 & cond1 & cond2, _AndList)
      assert len((cond1 & cond1 & cond2).filters) == 2
  
      assert isinstance(cond1 | cond1, Condition)
      assert isinstance(cond1 | cond1 | cond1, Condition)
      assert isinstance(cond1 | cond1 | cond2, _OrList)
      assert len((cond1 | cond1 | cond2).filters) == 2
  
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 11 for calling a global function with example usage: test_filter_remove_duplicates() without return types