class_docstr: A base class for tokenizers for NodePiece representations.
class_docstr_tok: ["A","base","class","for","tokenizers","for","NodePiece","representations","."]
docstr: Tokenize the entities contained given the triples.
  
  :param mapped_triples: shape: (n, 3)
      the ID-based triples
  :param num_tokens:
      the number of tokens to select for each entity
  :param num_entities:
      the number of entities
  :param num_relations:
      the number of relations
  
  :return: shape: (num_entities, num_tokens), -1 <= res < vocabulary_size
      the selected relation IDs for each entity. -1 is used as a padding token.
docstr_tok: ["Tokenize","the","entities","contained","given","the","triples",".",":","param","mapped_triples",":","shape",":","(","n",",","3",")","the","ID-based","triples",":","param","num_tokens",":","the","number","of","tokens","to","select","for","each","entity",":","param","num_entities",":","the","number","of","entities",":","param","num_relations",":","the","number","of","relations",":","return",":","shape",":","(","num_entities",",","num_tokens",")",",","-1","<","=","res","<","vocabulary_size","the","selected","relation","IDs","for","each","entity",".","-1","is","used","as","a","padding","token","."]
code: def __call__(
      self,
      mapped_triples: MappedTriples,
      num_tokens: int,
      num_entities: int,
      num_relations: int,
  ) -> Tuple[int, torch.LongTensor]:
      """
      Tokenize the entities contained given the triples.
  
      :param mapped_triples: shape: (n, 3)
          the ID-based triples
      :param num_tokens:
          the number of tokens to select for each entity
      :param num_entities:
          the number of entities
      :param num_relations:
          the number of relations
  
      :return: shape: (num_entities, num_tokens), -1 <= res < vocabulary_size
          the selected relation IDs for each entity. -1 is used as a padding token.
      """
      raise NotImplementedError
  
imports: import logging
  import pathlib
  from abc import abstractmethod
  from collections import defaultdict
  from typing import Collection, Mapping, Optional, Tuple
  import more_itertools
  import numpy
  import torch
  from class_resolver import ClassResolver, HintOrType, OptionalKwargs
  from .anchor_search import AnchorSearcher, anchor_searcher_resolver
  from .anchor_selection import AnchorSelection, anchor_selection_resolver
  from .loader import PrecomputedTokenizerLoader, precomputed_tokenizer_loader_resolver
  from .utils import prepare_edges_for_metis, random_sample_no_replacement
  from ...constants import PYKEEN_MODULE
  from ...typing import DeviceHint, MappedTriples
  from ...utils import format_relative_comparison, get_edge_index, resolve_device
label_desc: Use image node_id 1 for calling the Tokenizer obj's underlying member method code with example usage: obj.__call__(mapped_triples, num_tokens, num_entities, num_relations) without return types