class_docstr: A test case for quickly defining common tests for samplers.
class_docstr_tok: ["A","test","case","for","quickly","defining","common","tests","for","samplers","."]
code: def _update_positive_batch(self, positive_batch, batch_filter):
      # shape: (batch_size, 1, num_neg)
      positive_batch = positive_batch.unsqueeze(dim=1)
  
      if batch_filter is not None:
          positive_batch = positive_batch[batch_filter]
      return positive_batch
  
file_path: pykeen/tests/test_sampling/cases.py
imports: from typing import Any, MutableMapping
  import numpy
  import torch
  import unittest_templates
  from pykeen.datasets import Nations
  from pykeen.sampling import NegativeSampler
  from pykeen.sampling.filtering import BloomFilterer, PythonSetFilterer
  from pykeen.triples import Instances, TriplesFactory
label_desc: Use image node_id 7 for calling the NegativeSamplerGenericTestCase obj's underlying member method code with example usage: obj._update_positive_batch(positive_batch, batch_filter) and returns: positive_batch