code: def _normalize_representation_kwargs(
      dimensions: Union[int, Mapping[str, int]],
      interaction: Type[
          Interaction[
              HeadRepresentation,
              RelationRepresentation,
              TailRepresentation,
          ]
      ],
      entity_representations_kwargs: OptionalKwargs,
      relation_representations_kwargs: OptionalKwargs,
  ) -> Tuple[Sequence[OptionalKwargs], Sequence[OptionalKwargs]]:
      # TODO: update to hint + kwargs
      if isinstance(dimensions, int):
          dimensions = {"d": dimensions}
      assert isinstance(dimensions, dict)
      if set(dimensions) < interaction.get_dimensions():
          raise DimensionError(
              set(dimensions), interaction.get_dimensions()
          )
      if entity_representations_kwargs is None:
          # TODO: Does not work for interactions with separate tail_entity_shape (i.e., ConvE)
          if interaction._tail_entity_shape is not None:
              raise NotImplementedError
          entity_representations_kwargs = [
              dict(shape=tuple(dimensions[d] for d in shape))
              for shape in interaction.entity_shape
          ]
      elif not isinstance(entity_representations_kwargs, Sequence):
          entity_representations_kwargs = [
              entity_representations_kwargs
          ]
      if relation_representations_kwargs is None:
          relation_representations_kwargs = [
              dict(shape=tuple(dimensions[d] for d in shape))
              for shape in interaction.relation_shape
          ]
      elif not isinstance(relation_representations_kwargs, Sequence):
          relation_representations_kwargs = [
              relation_representations_kwargs
          ]
      return (
          entity_representations_kwargs,
          relation_representations_kwargs,
      )
  
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 3 for calling a global function with example usage: _normalize_representation_kwargs(dimensions, interaction, entity_representations_kwargs, relation_representations_kwargs) and returns: entity_representations_kwargs,  relation_representations_kwargs