class_docstr: Test the pseudo-type negative sampler.
class_docstr_tok: ["Test","the","pseudo-type","negative","sampler","."]
docstr: Additional test for corrupt_batch.
docstr_tok: ["Additional","test","for","corrupt_batch","."]
code: def test_corrupt_batch(self):
      """Additional test for corrupt_batch."""
      negative_batch = self.instance.corrupt_batch(
          positive_batch=self.positive_batch
      )
      # check that corrupted entities co-occur with the relation in training data
      for entity_pos in (0, 2):
          er_training = {
              (r, e)
              for r, e in self.triples_factory.mapped_triples[
                  :, [1, entity_pos]
              ].tolist()
          }
          er_negative = {
              (r, e)
              for r, e in negative_batch.view(-1, 3)[
                  :, [1, entity_pos]
              ].tolist()
          }
          assert er_negative.issubset(er_training)
  
imports: import numpy.testing
  import torch
  import unittest_templates
  from pykeen.sampling import BasicNegativeSampler, BernoulliNegativeSampler, NegativeSampler, PseudoTypedNegativeSampler
  from pykeen.sampling.pseudo_type import create_index
  from tests.test_sampling import cases
label_desc: Use image node_id 1 for calling the PseudoTypedNegativeSamplerTest obj's underlying member method code with example usage: obj.test_corrupt_batch() without return types