code: def normalize_rank_type(rank: str | None) -> RankType:
      """Normalize a rank type."""
      if rank is None:
          return RANK_REALISTIC
      rank = rank.lower()
      rank = RANK_TYPE_SYNONYMS.get(rank, rank)
      if rank not in RANK_TYPES:
          raise ValueError(
              f"Invalid target={rank}. Possible values: {RANK_TYPES}"
          )
      return cast(RankType, rank)
  
file_path: pykeen/src/pykeen/typing.py
imports: from __future__ import annotations
  from typing import Callable, Collection, Literal, Mapping, NamedTuple, Sequence, Tuple, TypeVar, Union, cast
  import numpy
  import torch
  from class_resolver import Hint, HintOrType, HintType
label_desc: Use image node_id 2 for calling a global function with example usage: normalize_rank_type(rank) and returns: cast, RANK_REALISTIC