from typing import Dict
from typing import Any


def readin_namelist_template(model_config: Dict[str, Any]) -> str:
    """
    The template specified within the `template` keyword in the
    `model_config` is read-in as namelist template.
    The placeholders within this template have to be specified by
    %PLACEHOLDER_NAME%.
    The placeholders are model specific.

    Parameters
    ----------
    model_config : Dict[str, Any]
        The `template` keyword from this directory is read-in.

    Returns
    -------
    template : str
        The read-in namelist template.
    """
    template_path = model_config['template']
    with open(template_path, mode='r') as template_file:
        template = template_file.read()
    return template