code: def make_model_cls(
      dimensions: Union[int, Mapping[str, int]],
      interaction: Union[
          str,
          Interaction[
              HeadRepresentation,
              RelationRepresentation,
              TailRepresentation,
          ],
          Type[
              Interaction[
                  HeadRepresentation,
                  RelationRepresentation,
                  TailRepresentation,
              ]
          ],
      ],
      interaction_kwargs: Optional[Mapping[str, Any]] = None,
      entity_representations_kwargs: OptionalKwargs = None,
      relation_representations_kwargs: OptionalKwargs = None,
  ) -> Type[ERModel]:
      """Build a model class from an interaction class hint (name or class)."""
      if isinstance(interaction, Interaction):
          interaction_instance = interaction
      else:
          interaction_instance = interaction_resolver.make(
              interaction, interaction_kwargs
          )
  
      (
          entity_representations_kwargs,
          relation_representations_kwargs,
      ) = _normalize_representation_kwargs(
          dimensions=dimensions,
          interaction=interaction_instance.__class__,  # type: ignore
          entity_representations_kwargs=entity_representations_kwargs,
          relation_representations_kwargs=relation_representations_kwargs,
      )
  
      # TODO pack/unpack dimensions as default kwargs such that they don't actually need to be used
      #  to create the class
  
      class ChildERModel(
          ERModel[
              HeadRepresentation,
              RelationRepresentation,
              TailRepresentation,
          ]
      ):
          """A ad-hoc child class of ERModel."""
  
          def __init__(self, **kwargs) -> None:
              """Initialize the model."""
              super().__init__(
                  interaction=interaction_instance,
                  entity_representations_kwargs=entity_representations_kwargs,
                  relation_representations_kwargs=relation_representations_kwargs,
                  **kwargs,
              )
  
      ChildERModel._interaction = interaction_instance
  
      return ChildERModel
  
file_path: pykeen/src/pykeen/models/resolve.py
imports: import logging
  from typing import Any, Mapping, Optional, Sequence, Tuple, Type, Union
  from class_resolver import OptionalKwargs
  from .nbase import ERModel
  from ..nn.modules import Interaction, interaction_resolver
  from ..typing import HeadRepresentation, RelationRepresentation, TailRepresentation
label_desc: Use image node_id 2 for calling a global function with example usage: make_model_cls(dimensions, interaction, interaction_kwargs, entity_representations_kwargs, relation_representations_kwargs) and returns: ChildERModel