class_docstr: A basic test for filtering.
class_docstr_tok: ["A","basic","test","for","filtering","."]
docstr: Test the filter method.
docstr_tok: ["Test","the","filter","method","."]
code: def test_filter(self):
      """Test the filter method."""
      # Check whether filtering works correctly
      # First giving an example where all triples have to be filtered
      batch_filter = self.instance(negative_batch=self.positive_batch)
      # The filter should remove all triples
      assert batch_filter.sum() == 0
      # Create an example where no triples will be filtered
      batch_filter = self.instance(
          negative_batch=(
              self.positive_batch + self.triples_factory.num_entities
          ),
      )
      # The filter should not remove any triple
      assert self.positive_batch.size()[0] == batch_filter.sum()
  
file_path: pykeen/tests/test_sampling/test_filterer.py
imports: from typing import Any, MutableMapping
  import torch
  import unittest_templates
  from pykeen.datasets import Nations
  from pykeen.sampling.filtering import BloomFilterer, Filterer, PythonSetFilterer
  from pykeen.utils import set_random_seed
label_desc: Use image node_id 3 for calling the FiltererTest obj's underlying member method code with example usage: obj.test_filter() without return types