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 _pre_instantiation_hook(
      self, kwargs: MutableMapping[str, Any]
  ) -> MutableMapping[str, Any]:  # noqa: D102
      kwargs = super()._pre_instantiation_hook(kwargs=kwargs)
      kwargs.update(
          {
              "mapped_triples": self.triples_factory.mapped_triples,
              "num_entities": self.triples_factory.num_entities,
              "num_relations": self.triples_factory.num_relations,
          }
      )
      return kwargs
  
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 2 for calling the NegativeSamplerGenericTestCase obj's underlying member method code with example usage: obj._pre_instantiation_hook(kwargs) and returns: kwargs