def file_format(file_format):
    """
    Check if file_format is a string 'png', 'pdf', 'ps', 'eps', or 'svg'.

    :raises TypeError: file_format must be a string.
    :raises ValueError: file_format must be a string given by 'png', 'pdf', 'ps', 'eps', or 'svg'.

    """
    if not isinstance(file_format, str):
        raise TypeError('\n\nfile_format must be a string.\n')
    if file_format not in ['png', 'pdf', 'ps', 'eps', 'svg']:
        raise ValueError(
            """

file_format must be a string given by,
 "png", "pdf", "ps", "eps", or "svg".
"""
            )
