from typing import Mapping
from typing import Any


def _get_param_or_die(input_params: Mapping[str, Any], param: str) -> Any:
  """Returns value of param. Dies with user-formatted message if not defined.

  Args:
    input_params: Mapping from input parameter names to values.
    param: Name of the param to get the value of.
  Returns:
    Value of the given param.
  Raises:
    ValueError: User formatted message on error.
  """
  value = input_params.get(param, None)
  if not value:
    raise ValueError('Missing parameter: %s' % param)
  return value