class_docstr: Tests for triple scoring post-processing.
class_docstr_tok: ["Tests","for","triple","scoring","post-processing","."]
code: def _pre_instantiation_hook(
      self, kwargs: MutableMapping[str, Any]
  ) -> MutableMapping[str, Any]:
      kwargs = super()._pre_instantiation_hook(kwargs)
      # mock prediction data frame
      generator = torch.manual_seed(seed=42)
      data = {
          f"{label}_id": torch.randint(
              max_id, size=(5,), generator=generator
          ).numpy()
          for label, max_id in zip(
              COLUMN_LABELS,
              [
                  self.dataset.num_entities,
                  self.dataset.num_relations,
                  self.dataset.num_entities,
              ],
          )
      }
      data["score"] = torch.rand(size=(5,), generator=generator).numpy()
      self.df = kwargs["df"] = pandas.DataFrame(data=data)
      return kwargs
  
imports: from typing import Any, Collection, Iterable, MutableMapping, Optional, Sequence, Tuple, Union
  import numpy
  import pandas
  import pytest
  import torch
  import unittest_templates
  import pykeen.models
  import pykeen.models.mocks
  import pykeen.predict
  import pykeen.regularizers
  import pykeen.typing
  from pykeen.constants import COLUMN_LABELS
  from pykeen.datasets.nations import Nations
  from pykeen.triples.triples_factory import AnyTriples, CoreTriplesFactory, KGInfo
  from pykeen.utils import resolve_device
  from tests import cases
label_desc: Use image node_id 1 for calling the TriplePredictionsTest obj's underlying member method code with example usage: obj._pre_instantiation_hook(kwargs) and returns: kwargs