from typing import Any
from typing import Type


def raise_exception_if_invalid_type(
        parameter_name: str,
        parameter_value: Any,
        expected_type: Type,
    ) -> None:
    """Raises a TypeError if the `parameter_value` given is not of the type `expected_type`; otherwise returns None"""
    if not isinstance(parameter_value, expected_type):
        raise TypeError(f"Expected `{parameter_name}` to be of type `{expected_type}`, but got type `{type(parameter_value)}`")
    return None