class_docstr: Tests for tokenization with precomputed token pools.
class_docstr_tok: ["Tests","for","tokenization","with","precomputed","token","pools","."]
code: def _pre_instantiation_hook(
      self, kwargs: MutableMapping[str, Any]
  ) -> MutableMapping[str, Any]:  # noqa: D102
      kwargs = super()._pre_instantiation_hook(kwargs=kwargs)
      # generate random pool
      kwargs["pool"] = {
          i: random.sample(
              range(2 * self.num_tokens), k=self.num_tokens
          )
          for i in range(self.factory.num_entities)
      }
      return kwargs
  
imports: import random
  from typing import Any, MutableMapping
  import numpy
  import numpy.testing
  import pytest
  import scipy.sparse.csgraph
  import unittest_templates
  import pykeen.nn.node_piece
  from tests import cases
  from tests.utils import needs_packages
label_desc: Use image node_id 1 for calling the PrecomputedPoolTokenizerTests obj's underlying member method code with example usage: obj._pre_instantiation_hook(kwargs) and returns: kwargs