def read_preamble(filename):
    """Reads the preamble file.

    Args:
        filename (str): the name of the preamble file

    Returns:
        str: the preamble

    """
    if filename is None:
        return ''
    preamble = None
    with open(filename, 'r') as i_file:
        preamble = i_file.read()
    while not preamble.endswith('\n\n'):
        preamble += '\n'
    if not preamble.startswith('\n'):
        preamble = '\n' + preamble
    return preamble
