import typing


def _get_key(
    source: typing.Optional[dict],
    key: typing.Any,
    default: typing.Any = None,
) -> typing.Any:
    """Fetch the value of the key in the source or the default if not present."""
    return (source or {}).get(key, default)